Well, if any country is being invaded, that generally means the invaders are the kind who, well, resort to invading. The kind who resort to invading tend to not be the kind of people I want "in charge", no matter how horrible the current people "in charge" are.
Unless, of course, that's the whole point of the invasion, being that the current people in charge suck, at which point I would already be part of the internal resistance, or have bailed.
So, if the invasion is to improve my country, I'm already a part of the invasion force, essentially. Like when the allies re-invaded France. Invasion/Liberation/Crusade, it all depends on which side you're on and which context you apply to it.
If the invaders, rather, are the standard "invasion" types; if I run, and every one else, they'll eventually catch up to wherever I end up, so I might as well fight and die where I stand.
That, and I'd rather protect my family and friends, and the places where I have memories with them.
Also, I rather don't mind my country so much. Sure, there are a lot of jerks in politics, corporations, and the general population; but it isn't too bad of a place in the day-to-day.
Besides, if I just protected my home, family and friends, that's a lot of work for one person, or even a small group of people. A whole lot of people working together to protect a whole lot of land in a concentrated effort, however, tend to do better. That's kind-of the whole point we started "grouping up" in tribes, villages, cities, principalities, and dun-dat-ta-da! countries.