I think you are probably referring to a beta of Windows 3.1 which deliberately barfed if run on any version of DOS that wasn't MS-DOS. That code was never included in any final non-beta product.
Windows 95 doesn't care what version of DOS you have because it replaces it with its own - MS-DOS "7.0".