SSH can forward a Unix socket, not only a TCP port. It works nicely until the first connection dies and leaves its socket file behind. The next attempt then fails, and this option is the fix.
ssh -o StreamLocalBindUnlink=yes -L /tmp/app.sock:/run/app.sock host
The man page lists local_socket:remote_socket as a form of -L. The example creates a socket file in /tmp on your side and connects it to /run/app.sock on the server. Tools that speak to a Unix socket can then use the local file.
If that file already exists and StreamLocalBindUnlink is not enabled, ssh can’t forward the port to the socket file. With the option set to yes, ssh removes the existing file before it creates a new one. The default is no.
Remote forwarding to a socket works the same way, with -R remote_socket:local_socket. There the server does the binding, so the setting that counts is the StreamLocalBindUnlink option in sshd_config, which also defaults to no.
Host app
StreamLocalBindUnlink yes
One caveat: the option only applies to forwarding to a Unix-domain socket file. For ordinary TCP port forwards it does nothing. Also, it deletes whatever is at that path, so keep the socket in a folder of its own so you never point it at a file you care about.
Further reading: ssh_config(5), sshd_config(5)