Short answer is yes, but there's lots of ways to do it.
While my example was simple to keep the concept count low, the next step you would do is make the Nginx configuration file to be volume mounted so that way you can write (add/update) new entries that could be containers on separate VMs.
Again, there are many ways to do this. One way is to listen to Docker for when a container has been created or destroyed. To do that, you can listen to docker events, like if a new container is spun up, it's added to the load balancer.
That works great on a single VM by default. To have it work across multiple VMs, you can use Docker Swarm. Docker Swarm allows you to add, say three VMs into one logical VM. More info on Swarm can be found here. The nice thing about Swarm is you can use the exact same commands, like the Docker events to get information on state changes for containers across multiple VMs.
So back to our example, setup 3 VMs using Docker Swarm, choose one of those to run Nginx with a volume mounted config file, listen to Docker events and add/update the config file based on what containers are running on what machines.
Each clustering/orchestration tool will have their own answer for this as well, so again this is one of many solutions.
Hope this helps.