More than any other label, "nightmare comedy" is one that's most often used to describe Dr. Strangelove. While it's hilarious from start to finish, the movie depicts a nightmare nuclear scenario that ultimately leads to the end of life on Earth. What's funny about that?
Dr. Strangelove is also satire, meaning that it uses its absurd comedy to point out what it sees as very serious social problems. You know...like that whole massive build-up of weapons with the ability to destroy the world. Throughout, Dr. Strangelove shines a spotlight on the policies that led the world to the brink of destruction. While intending to make a serious film, Kubrick realized that so many of the policies and people he was depicting were so absurd that he decided that was the important content.
And since movie started out as a serious thriller, part of what keeps us glued to the screen is the high-stakes, fast-paced action, and twisty-turny plot.