I am a Muslim. Although, not a learned one. So, I am only giving my unlearned personal view.
Here's what I think. I think as a Muslim, morality should override any oaths. If I swear loyalty to another country, it's all good. But, when that country is in the wrong (morally speaking), let's say...