Different companies have different rules, read your contract.
Usually temporary contracts are just that, the company takes the risk that you might leave early with a minimum notice period, against the fact that you are cheaper as a temporary contractor.
I have left temp contratcs early for permanent contracts, they don't like it, but can't stop you.
The only thing I would careful with is if they are a big employer locally, don't want to burn your bridges for the future!
Regards
Ben