The easiest way would be to do it with a set built for one environment/room and the door frame with the door; on the other side, where the second environment/room is supposed to be you can have a chroma screen. For example, actor walks out of living room (real set) into a desert (composited using green screen).
The next best thing is to have just the door frame in front of a chroma and replace both environments.
There may be other ways, but it depends a lot upon your script, storyboard, locations, budget, skill and so on.
For other ideas and better feedback post more details.
Tudor “Ted” Jelescu
Senior VFX Artist