I don’t think it would be illegal unless it’s a Chromebook they lended to you directly to work at the company. If you went to a store and bought it your self it’s perfectly legal to throw ubuntu on that Chromebook.
Here’s where things start to get harder though…
Whether they will fire you… eh idk if I would take that risk. But if anything just ask the people working there for their opinion on it.
Even the scrapping in theory could be restricted. I might be wrong there.