LaTeX Workshop can work with VS Code Remote Development extensions. You can see their technical details. Not only you can edit a TeX file inside a Docker container or in WSL, but also you can preview the pdf file.
You can also edit a TeX file on a remote server and preview the pdf file. However, when you use this feature on a remote server, please consider the following security risks.
VS Code Remote Development extensions start a server to host VS Code extensions on the remote server. Other users on the remote server can access the server.
LaTeX Workshop starts a http server to preview the pdf file on the remote server. Other users on the remote server can access the server and can read your pdf file.
VS Code Remote Development extensions are NOT supposed to be used on a usual server logged in by multiple users.