It might depend on country but I can tell how it works in Finland.
If you are in Finnish army then you will fight against your other country. But Finnish army doesnt allow being member of multiple armies. So if you have gone trough, as an example, US service Finnish army wont accept you. And if you go to US army after gaining rank in Finnish army you lose the Finnish rank and are just a civilian.