I found out a way to get MacOS on a vm in VirtualBox (This is for windows hosts). I don't know of you can do this with other versions of macOS but i do know that you can do it with Ventura for as i tried it myself. To do this you have to first download the iso (i swear it takes such a long time to download a 6GB iso file) from macOS ISO : Free Download, Borrow, and Streaming : Internet Archive and then you should be on a page. From there you can hover your mouse over the "iso images" text in the page witch should give you a down arrow button for a drop down menu. When you are in the dropdown menu you will see a list of files. Hover your mouse over the "ventura" iso file witch should give you a download button next to the text just like for the iso images dropdown menu. Once you have clicked the download buton and it downloaded you can open VirtualBox or download it from Downloads – Oracle VirtualBox. Once you have opend it or installed and the opened it create a new vm by clicking th "new" button on the top bar and then open the dropdown menu "Type" and select the option "Mac OS X" and then select skip unsttended installaion and then click finish. Once you have created the vm select it in the vm list and then click settings on the top bar. Once you are in settings you can click the "display" button and then on the right side of your screen you should see a slider bar for the video memory. Set the video mem to max, then go to stroge and click the "empty" button that has a cd disk image on the left side of it. Once you click the button you should see a list with a button that says "SATA Port 1". Click the cd disk image next to it, then click "Chose a disk file" and select the iso file you downloaded erlier. Once you have done that you can click the usb button and select "USB 3.0". Once you are done with that then you can go to genearl and then copy the name for later. Once you have copied the name then click "ok" to save your chnages. Now ever since you have created the vm, you have to make MacOS think that the vm is a apple compyter. To do that you are going to run a few commands in command prompt. First, open command prompt and type the following commands (also btw in the commands replace "VM NAME" with the name of you vm that you copied, or you can just type it manualy of curoce) one by one:
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage.exe modifyvm "VM NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "VM NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac19,3"
VBoxManage setextradata "VM NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "VM NAME" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "VM NAME" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "VM NAME" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
Once you have finished writing those lines of code you can run the vm and set it up and you got MacOS Ventura in VirtualBox!
WindowsTechNerd
btw ever since the iso takes so long to download, please fine me a faster download link here in the comments if you can. Thank you!