Can my work legally do this?

sounds like you work in tech support, and you are upset that you have an oncall rotation? Welcome to the real world.