I guess I found the context here: How to Edit config.php in Docker Desktop
I’m not familiar with Docker Desktop, but if it’s running under your normal user account and the volumes or bindmounts live in your home directory, you probably can’t deny access to them. However you can certainly configure them to be somewhere in a subfolder of your home dirctory, or maybe in a hidden folder, where it is less likely that you accidentally change them.
Otherwise, I can only say that a personal work computer is not necessarily the ideal place to host a productive Nextcloud instance, and Docker Desktop is afaik primarly designed for developers to test their images with it, and not necessarily to run productive server applications.