There are no restrictions on UK citizens joining the armed forces of a foreign state other than those related to the Foreign Enlistment Act of 1870. This Act makes it an offence for a British subject without licence from Her Majesty the Queen to enlist in the armed forces of a foreign state at war with another foreign state, which is at peace with the UK.
There is no general restriction on UK citizens joining armed organisations that are not under the direction of a state. However, in certain circumstances, a UK citizen engaging in military-style operations as part of such an organisation might be in breach of, and hence liable to prosecution under, specific UK legislation. A case in point would be counter terrorist legislation, which enables the prosecution of those who commit terrorist offences overseas.