Of course they can sack anybody. You can speed, steel, kill even, but it is not legal and therefore you will suffer the consequence!. If you are paid money in compensation for being sacked unfairly, then the company has broken the law, that is why you are being compensated.