Turbo Pascal 7, the last one for DOS, was released in 1992, one year before Mosaic. Later on you could set up TCP networking and a web stack to work on DOS (e.g. Arachne) but this was very uncommon. Typically you'd have a GUI browser running in Win 3.1, not directly on DOS. But I can't think of anyone actually trying to serve anything weblike from DOS. It's not a server OS, quite obviously so, so what's the point?
In principle I suppose CGI would work just fine for these hypothetical purposes, so long as everything is completely synchronous (so each CGI handler blocks all request processing while it runs).