You can, but it be comes quite difficult to secure and manage very quickly. Nikos talks about the SSH use case at CERN in this video [1] and mentions that they tried quite a few things before ending up with ContainerSSH.
[1] https://youtu.be/d6aCBiInMbg?t=525