The DOS header is only used for backward compatibility, and precedes the DOS stub that displays an error message stating that the program might not run in DOS mode.
As per the official PE documentation (available at https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#ms-dos-stub-image-only), the MS-DOS stub enables Windows to properly execute the image file, even though it has an MS-DOS stub.
It is placed at the front of the EXE image and prints out the message, This program cannot be run in DOS mode, when the image is run in MS-DOS.
The DOS header includes some fields for backward compatibility, and is defined as follows:
typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header WORD e_magic; // Magic ...