They can, but only if you have an actual contract to that effect.
It's possible that if you're in an at-will employment state they could fire you for cause and claim that working for another company violates something, but I think that would be legally a bit dicey.