I’ve done like below:
Identify who is the player 1 (generally, the host) and player 2.
You make player 1 build the dungeon and then share the dungeon seed with replication or API call (in case you are using a Cloud Service like us) to another player.
Then, he will build the dungeon himself.
In this way, both players will play in the same dungeon.
Another way of doing this, if you can use cloud code, is to make server generate the seed for both players and send it via message to them.