D-sub was conventional for computer connectors, while DVI is a common connector for video demonstrations. DVI is rather new, while D-Sub was used for a wide variety of applications. DVI was intentionally developed to send video signals. In contrast, the D-sub connector is used for a much more comprehensive range of applications.
This diversity includes VGA displays, serial ports, parallel or printer ports, gamepads, and even mice. The only D-Sub connector is still being widely used today as the DE9 connector for monitors. DVI diffuses analog and digital signals it's D-Sub equivalent only carries analog signals. DVI is specific to the video display, as there is no point in having an array of confusing connectors.