If your discharged from the army and then moved to another country and became a citizen or permanent resident you can join that countries military if they accepted you
Seen good interview with Brit paratrooper who became a member Special Forces in the USA
And any ex soldier can join the French Foreign Legion .