Over the years, many Wolf3D modders and game developers have released the source code to their games, to help others learn, or use the games as a base for new projects.
These engines are available thanks to them. If you use a game’s source code, or part of it’s code, be sure to thank the original authors.