If you use ESXi then the Mac will boot in to the ESXi hypervisor and run OS X as a guest. It is also possible and legal to run OS X as a guest in VMware ESXi but again only if you are using a real Mac. In this scenario if you used VMware Fusion or Parallels or VirtualBox they would all allow running an OS X guest in a virtual machine on a Mac running OS X as the host. It is hypothetically possible to get round this problem but does require more expertise and additional tools. VirtualBox has no built-in support for OS X guests even on a real Mac host and as a result even if you did make an iso image of OS X which is possible, by itself it will not work. However it is also the case that VMware Fusion and Parallels have built-in support for OS X guests to make it much easier to install and setup an OS X guest it is therefore not necessary to make a special OS X iso image. While VMware Fusion and Parallels implement checks and will only allow an OS X guest if the host is a real Mac I don't believe VirtualBox does this. The same would apply to VMware Fusion and Parallels. Therefore yes it would be legal to run OS X in VirtualBox if VirtualBox is running on a Mac. It is only legal to run OS X in a virtual machine if the host computer is a Mac.