If I run
docker run -it ubuntu bash
Does it actually SSH into the container, or does it use another protocol?
No, it uses an internal "attach protocol" via the Docker daemon.