A typical situation may be:
$ tmux
[0] $ ssh example.com
$ tmux attach
[0] $
I open a tmux session, then ssh in to a serve
EDIT:
I do NOT recommend use C-q as a bind-key, as it is a default control-key command for
un-freezes the screen and lets screen display continue
A situation happens here, and @Paschalis provides a solution:
if it happens to be twice unlucky (a remote tmux session with C-q as prefix): Type
Cltr-q, then:, and enter in tmux:send-keys C-q
To make it simple, add the below line in your ~/.tmux.conf
bind-key -n C-q send-prefix
Then you can directly use C-q as bind-key for your remote tmux.