Oh, you can. You just need to provide a valid reason, that's all.
Firing someone because they are stealing from the company, harassing a coworker, consistently underperforming, or because you're shutting down a business unit? Easy!
Firing someone because it's a Tuesday, or because they got pregnant? Sorry, can't do that.
Collecting data in order to come up with a valid reason is prohibited. Like, impossible to fire a programmer if he only does a bare minimum and simply is not productive.
Firing someone because they are stealing from the company, harassing a coworker, consistently underperforming, or because you're shutting down a business unit? Easy!
Firing someone because it's a Tuesday, or because they got pregnant? Sorry, can't do that.