I searched for keywords:
macos sandbox environment
This was a top hit:
Restrict access to system resources and user data in macOS apps to contain damage if an app becomes compromised.
developer.apple.com
There are probably more related docs.
Here's an article that was farther down the list:
Hi there! It’s GeoSn0w. The macOS Sandbox has always been a mysterious thing that I liked to poke at with various tools and with the knowledge I have gathered from reference books such as Jonathan Levin’s *OS Internals, and Apple’s own not-so-detailed documentation. Of course, it’s nothing new...
geosn0w.github.io
It's from 2018, but it seems well-written.
A virtualized environment like Parallels might be made to work. A typical VM presents only an artificial set of resources to its hosted code. One could put as many layers as one wished between the foundational VM and the desired "sandboxed environment", including running a Linux distro under the VM, then using actual Linux namespaces.