It's no problem. Remember that HAProxy is simply forwarding CONNECTIONS and doesn't care what the URL is (unless you've setup rules to filter by URL).
It's Apache (or whatever webserver you're using) that has to be configured with the virtual hosts. There should be a different virtual host for every domain you want to use.
A standard HAProxy config will load balance all requests regardless of URL, eg:
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
listen http_proxy HAPROXY_SERVER_IP:80
cookie SERVERID insert indirect nocache
server web01 WEBSERVER1_IP:80 cookie web01 check
server web02 WEBSERVER2_IP:80 cookie web02 check
Setting up virtual hosts in Apache is a very common task and you can easily find some information on that with a quick Google search if you're not sure.