Automate ssh connection and execution of program with Python’s Paramiko

I want to automate a specific task using python.
This task includes, among some other things, connecting with ssh to a remote server, and running a specific program (call it prog.out) that may or may not ask for user input.
After some research and after weighting my options, I decided to use Python’s Paramiko (which may turned out to be wrong, considering the below…).

How can I configure a reverse SSH connection to the connecting computer?

I’m going to be deploying a number of machines in the near future which will be behind routers. It won’t be feasible to set up dynamic DNS on each router and port forwarding, so is there a way I can configure these machines to initiate a TCP connection to my computer and then have my computer initiate a SSH connection to the remote computer over that connection?