There are about 190 countries in the world and although there are plenty of people who don't believe in the adage "my country, right or wrong", most people do believe in defending themselves especially from foreigners or outsiders that would attack them, their institutions, their beliefs, their land and to also to protect themselves from those who would take aggressive actions against them, whether foreign or domestic. Not all of us are born into wonderful countries that are known for freedom, liberty, and the American way; in fact, most people are born into countries that are in various degrees of misery, poverty, and oppression. Even worse within that country, your education may be limited, your economic choices may be anemic, and your freedom of both thought and movement may be severely constrained, yet, within that all, this is virtually all that you really know.
Consequently, when your country is under attack, in the normal course of events, your native sympathies will be to protect the little that is yours. It is not your fault that you have been born in a particular country, that is just your lot in life, whether for good or for bad, and in all likelihood you will do the best that you can do given your circumstances. However, when put into the position in which your life, your livelihood, your home, and your family, are in imminent danger you will almost without hesitation do whatever is necessary to protect your turf, whether compelled to do so by your country's law or military or not.
Therefore in the scheme of things, you are not concerned, in fact it's not even really a thought, whether your country is in the right or the wrong. What you are concerned about is somehow your country is under attack and this fight is a fight for survival, nothing more, and nothing less. In most cases, you know the basic law within your country, it may not be ideal, it may not be desired, but it is the conditions that you have accommodated yourself to. In all probability, especially with propaganda that demonizes those that attack your country, you will be cognizant of the fact that if your country is defeated that things will get worse, perhaps much worse, because after all there will be a new master to answer to and he does not know you, nor will he care to respect you.
It is not wrong to defend your country. During our civil war, there were two sides to this conflict, in which for the most part, the country was divided into a clear sectional conflict. Those that were from the southern States that seceded opposed the rest of the nation that remained as a modified United States of America. Whether your physical presence was in the North or in the seceded Southern states, it was that physical location itself that determined in most instances the side that you fought on. You may not have had a strong feeling about the war one way or another, but by golly, when a man in a different color uniform is trying to kill you, to take and destroy your property, your family, and your land, you will defend yourself or perish.
Those that defend their country are only doing the natural thing in the given circumstances, they aren't traitors, not even in our civil war in which the South was vanquished but allowed to come back into the Union upon a loyalty oath and ratification of the 13th Amendment to the Constitution forbidding slavery. You will defend yourself, you will defend your country, and you will do this because the unknown and the uncertain are far scarier than the known and the certain. Few people welcome their conquerors, and fewer still are satisfied with them, it is the exception to the rule when conditions improve upon conquest