I think Jefferson went into the hat and into the place between worlds with the doors.
Good point if there were doors in the room where he was surrounded by all of the hats. If it were that room between worlds with the doors why does he just open any door? Look carfefully that was a room with a huge window in the back and lit with a lot of hats all aroung him. There were no doors that can be seen. It does not appear to be the same room but nevertheless when he entered Wonderland he did not need a key. If he were in that room with the doors why would he need to make hats? The hat was of the first world they jumped in from.