Docker Engine uses a feature of the Linux kernel called namespaces. Alternate OSes require a Linux VM. As another commenter mentioned, apps like Orbstack, Podman Desktop, and Docker Desktop provide a facility to create such a VM.