You might like to use the sshspawner. You can then run the JupyterHub on one machine and connect to the other machine.
Regarding the part of “based on conditions”, I guess the easiest is to programm your own spawner that implements exactly the logic you want, maybe mixing the code from several spawners that you like.
wrapspawner can be used to select from multiple Spawners based on different conditions. So you can have one sub-Spawner that launches in kubernetes with KubeSpawner, and another that launches elsewhere with SSH or some other. If you set up Docker with tcp/tls, you could probably make the remote spawner be DockerSpawner, if you can get the docker client credentials and environment setup into your Hub container.