It is a contract-a legal obligation. However, if by mutual agreement, seller wants to compensate the buyer, it can be cancelled.
Also, if the timeline has passed, closing timeline, etc. or if any of the terms of the agreement are breached, they can cancel with no penalty.
One time seller can cancel is with attorney review or inspection contingency, if the buyer or buyer's attorney wants something the seller does not want to give, they can usually cancel.
Talk to your Realtor and most of all, your attorney to see what your rights are under the contract and what the seller's rights are too.