You can create your own Docker image which let you ssh into a container.
The Docker.inc official Ubuntu/CentOS images uploaded on Dockerhub does not offer some functionality which can be run as SSH server as a default.
To build some Docker image which can run SSH server, you can refer to the official documentation.