The doorway was created by Samuel Lumber in the 1890s for the purposes of studying the dreams of his patients. However, instead of the doorway being used to enter dreams, nightmares used it to escape outside of dreams. The nightmares kidnappped Lumber and brought him back with them to the dream world.
After reading about the doorway in the paper, the Paternoster Gang came to Lumber's office to investigate for any potential dangers and discovered that things had gone wrong. Vastra used her sonic hat-pin to open the door and Jenny Flint - being the only human member of the gang - went through the doorway and rescued Lumber. Vastra then sealed the doorway with her hat-pin and advised Lumber to never open it again. (PROSE: The Dangerous Dilemma of the Dream Doorway)