Certainly not in general! That very much depends on the country and the immigration status under which you are in that country. Most visas strongly restrict the right to work. If you leave, you may not be allowed back in, unless you can obtain fresh clearance.
Under the Oslo Accords, signed by Israel and the PLO, the recognised representative body of the Palestinian people, the West Bank is partitioned into areas designated A, B and C. That agreement gives Israel control in area C, the Palestinian Authority control in area A, and B is somewhere in between. Israelis are forbidden to enter area A, by the way. Israel conducts itself in accordance with this agreement signed up to by the PLO.
Anything else is pending further negotiation between the two parties, and perhaps a final status agreement (though I am increasingly pessimistic about the potential for a final status agreement).
So, I absolutely do not think it's "one of the other". It's an extremely rare situation in human history with no specific well-trodden path for how it should be resolved. Israeli prime ministers have offered the Palestinian leadership their own state twice in the 21st century. Both offers were rejected.