Yes, as long as you have virtualization enabled in the bios it will be fine, having only 8Gb will limit how well big apps will run but that's the same as in windows.
Virtualbox will also only simulate a very simple GPU so this will limit what you can run on macos as well.