Depends on the contract - many/most (most/many??) have a resignation notification period often 3 months or so.
If the contract does NOT have a resignation clause (and one US agency in Japan has such a contract for at least one of its positions) Dominican has a very valid point.
But why would anyone ever sign such a contract??