If Esc was all you had to press to
completely close a program, using computers with modern operating systems would be a nightmare.
It would be possible to get completely kicked out of banking apps, chat software, development environments, Microsoft Word, etc. by pressing 1 key.
Alt-F4 just difficult enough to type that nobody will accidentally do it, and it has been the Windows standard since 1994. For 15 years, all Windows software has been designed to accept the Alt-F4 keystroke to exit. By the way, in Firefox, you can close individual tabs with Ctrl-F4.