Completely untrue since at least the 1970's and probably far longer. Like all UK citizens, service personnel have to register to vote where they live, and if overseas they need to arrange a postal or proxy vote. Not only is it allowed, it is actively encouraged. I think the only restriction is that you are not allowed to wear uniform if taking part in political activities.