Can I have two websites with one front page

You can create a static front-page in your theme. If you’re using front-page.php, you are free to put anything in there, you don’t have to rely on the loop.

However, I’d rethink this. If a user that goes to domainA has to click another time to actually get to the contents of domainA, you’re increasing the probability of him leaving. It’ll get especially annoying for people who will have to affirm their choice multiple times. A prominent message (“Looking for green widgets? We’re dealing in red widgets only, but our friends at domainB will make you happy”) that gives the option to switch but doesn’t include an extra step to get to your content might be better.