Likely anything that goes beyond missing out on compensation (ex: unvested RSUs) or even clawing back some comp would violate labor laws. CEOs are still employees, and legislation regulating employer-employee relations trumps all contracts.
There are many many instances where the CEO is not an employee, but they operate via their own legal entity. To be honest I don't know how this works at larger companies.
A lot of these labor laws get less protective for higher-ranked people in a company, whether it be due to thresholds based on compensation or explicit carve-outs for executives/board members. It varies a lot from place to place.