Yes this is possible using
nsenter or similar tools, depending on what you want to do you can also use Docker tooling.
A Docker container is just a namespaced Linux process, so using namespace aware tools you can execute a command from the host inside a given namespace.
For example, say you want to use
tcpdump to diagnose a problem with networked nginx web site.
you can run
docker run -d --name nginxtest nginx, to start the container, then run
ps -ef | grep -i nginx and get the PID of the nginx process.
Once you've got that you can use something like
sudo nsenter --target [PID] --net /usr/sbin/tcpdump to run TCP Dump from the host inside the network namespace of the nginx container.
Another option is to use a sidecar container which shares namespaces with a main container. So for example you can run
docker run -it --net container:nginxtest raesene/alpine-containertools /bin/ash to run a new container which shares the network namespaces of the nginxtest container.
For mount namespace, it's a little more complex but still possible. you can view/edit files via the
proc filesystem. So for example
vi /proc/[PID]/root/etc/passwd would allow you to view/edit the
/etc/passwd file from the running container . With this you do need to be careful of file permissions