Can Thai employers cancel a work permit? Who has the right to cancel an expatriate's work permit? What are the ground for cancelling an expatriate's work permit?
A work permit can be cancelled at any time by the employer. They do not have to give a reason, and they should tell you about it when they want to cancel it. If your extension (see below) is affected, they need you to go to have it cancelled at the same time.
There are a few points to be wary of regarding the expat's ability to stay in Thailand:
The difference between a visa and an extension is that a visa is always issued outside Thailand and gives you the ability to enter Thailand, and an extension is only issued within Thailand.
EDIT: Actually, thinking about this - they need to give you notice as specified in your contract of employment, and if they do not then they are in breach of that contract. The Department of Labour is surprisingly good at getting companies to honour their employment contracts - although in a case like this the most they can probably do is get the company to pay you an extra month's salary. But they usually work very quickly (it won't take many days to get it sorted).