Actually if you look at it from a completely Islamic perspective, you will find that there is no concept of countries in Islam. All the muslims belong to one nation. "The Believers are but a single Brotherhood" (Quran 49:10). A lot of scholars have interpreted it to mean a single nationality of muslims.
It follows from above that what a muslim should do in times of war is what is generally expected from a person if his countrymen are threatened or attacked. It does not matter whether a muslim lives in this country or that.
And because you bring up Palestine, I will bring up the cruasades of the 12th century. And in the response of the muslims to the occupation of Jerusalem by the crusaders in 12th century, we have a great precedent for us. We should do exactly what the muslims of those times did.
In Salahuddin's army people from as far as Syria, Egypt, Yemen enlisted. The ethnic diversity of his army was astounding. Africans, Turks, Arabs, Kurds all of them had come to fight the Christian crusaders and liberate the holy land.
So from a purely objective point of view all muslims must fight alongside against the enemy in times of war particularly if that battle is a defensive battle like in Palestine.
But the constraints of today's situation do not allow the above to remain feasible anymore, this is another matter. Some of these constraints, of course, are self-imposed. For example, you would not wish to leave the luxury of your home to go and suffer with the Palestinians. After all they are citizens of some other country, aren't they?