I researched a similar effect few years ago when I was trying to replicate part of the game `AntiChamber` in Unity.
At the time, I found out about Stencil Buffers, which did let us create a cube with various different rooms on the different faces: https://www.youtube.com/watch?v=5DKIP9N-OB4
Since then, there has been more "Portals" technique released, among which this blog post which seems to achieve a similar result: http://tomhulton.blogspot.com/2015/08/portal-rendering-with-...
Another game which uses a different type of geometry is HyperRogue: https://www.youtube.com/watch?v=2DtUJ_x_2Hc
It has a hyperbolic plane instead of a regular rectangular one.