Well, perhaps not. Some contracts have clauses that say you must stay at your job (no exit permit or payment) until a replacement for you is found. And some contracts stipulate that if you resign before one year you owe back expenses such as airfare and visa costs.
Mandi