In most time, VirtualBox is safe. It is safe enough to execute programs in a virtual machine. However, it is not totally safe. The malicious code can escape the virtual machine if you configure a virtual machine poorly, which can cause some issues.