Yes it will work and it will be the same as running it directly on a laptop.
There are some caveats though:
Tor expects nodes to be stable. If you are regularly rebooting your laptop or VM or removing the USB, then this isn't a stable connection and the relay will never see much traffic.
A better option would be to just install Tor on a cheap dedication ...