In short yes, they can back out of a contract at anytime. However, depending on the reason or time, they could be in default of the contract and open themself up to legal damages.
How do you write a contract for sale? Title the document appropriately. List all parties involved in the agreement. Detail the product or service, including all rights, warranties, and limitations. Specify the duration of the contract and any important deadlines.