For well paying jobs it’s pretty rare unless you do something bad. Obviously if they just did that to random people it would really hurt morale and other workers may want to leave.
But it’s legal. On the other side, with similar exceptions, on any day you can walk into your job and say goodbye forever and never come back.