VirtualBox emulates a generic soundcard, which the guest OS talks to as if it is a physical soundcard. The emulated soundcard's output gets fed to the host OS's audio stack; VirtualBox is just another audio application from the host OS's standpoint.
I'm not sure how much (if any) resampling is done; one would assume there isn't any if the real and emulated soundcards' sampling rates match, but who knows. You can expect some occasional clicks and stutters, since interrupt latency in the guest OS is gonna suck, and soundcards (whether real or emulated) are generally sensitive to interrupt latency. Overall audio latency will be worse than native audio, since you've got the latency of both audio stacks (guest and host) added together. You've also got an additional software mixer in the signal path, so there's more potential for fidelity degradation due to roundoff errors, even if there's no resampling; setting the volume in the guest to maximum and controlling the volume solely with the host OS's audio mixer ought to mitigate this.
In a nutshell, don't expect a particularly high fidelity experience if you play audio inside a VM.
It is probably worth trying connecting a USB soundcard/DAC directly to the guest OS (via the Devices menu), and allowing the VM to drive it directly. No idea if this is actually better than emulation in practice, as I have not tried it.
Nostalgia isn't what it used to be.