For Linux it is easily testable since you can have a relatively lightweight and completely legal Linux virtual machine inside a VirtualBox for example. Even with GPU acceleration and stuff.
Mac OS seems to be also legal to have in a VM for free though from the development point one should notice that Mac deprecates OpenGL rendering in favor of Metal (though maybe UE manages that automatically).