I mean - I would argue that you can do horror in D&D, just not every
kind of horror. D&D is (usually) a world where the Divine exists as a matter of fact, and cares enough about people - for good or ill - to interfere in people's lives and grant power to their followers through prayer. It's a gnostic world: angels and demons exist as Good and Evil things with form and extension in space and time - you can punch an angel and slap a demon on the back. If the central fear at the heart of cosmic horror is that nothing has meaning and everything is rudderless in an uncaring and alien cosmos, it's kind of antithetical to the whole idea of the game.
But
slasher horror?
Body horror? There's totes things you can do in D&D.
edit: it's been a minute since I had a good back-and-forth on here with you and
@Parmandur. Always nice to chat with you guys.