Of course. Containers might face some slight configuration hurdles depending on your setup, since they share the network stack with the host, but for VMs there's absolutely no problem - they pretty much behave like any other physical server plugged into the network via a switch.