If you are running the Mendix Runtime Server behind an Nginx or Apache webserver, you could set up rewrite rules like so:
www.companyA.com -> http://mendixserver/link/companyA
www.companyB.com -> http://mendixserver/link/companyB
You can do this just for the root page and the login page and let all other requests go through without rewriting.
Would that solve your problem?
Apart from trying something else, like Rewrite Conditions/Rules using mod_rewrite, you can try and write your own logout function if you prefer Deeplink.
It should be straight forward to kill a session via microflow and the depending on the state of your Brand before logout, you can redirect to a different anonymized deeplink URL for that specific brand using a redirect appstore module.