If the terminations are happening for the purpose of depriving employees of stock-related compensation they are about to earn, that may be an illegal reason. For example, you cannot let a salesperson snag a huge deal and then fire him or her to avoid paying the commission - it’s not an “at will” issue.
RSUs only vest if you are an employee the day they vest. If a salesperson wins a deal and you fire them before paying their commission that’s different since they closed the deal first.
It’s very common for companies to let individuals go before bonuses vest.
I would certainly recommend any employee in this situation to get legal counsel. Terminating an employee for the purpose of preventing them from satisfying conditions precedent to a payment is a bad-faith move that some courts will set aside.