Don’t post questions in the “Configuration Samples” section, this is for people PROVIDING configurations samples, not asking for it.
You can use haproxy in multiple datacenters or with GLB (whatever technology you use), there are no particular restrictions in haproxy that prevent you from doing so.
But it is a little more complex than copy and pasting a example configuration from a forum thread or blog post to your machines. The fact that you shared zero technical requirements and design choices makes me think you did not spent a lot of time with this yet, so my suggestion would be to get commercial support or hire someone who can do this for you.