Why? Ultimately, D&D is game for relaxing with friends. Some players come to escape from the complexities and evils of the world for straight forward moral questions. Others enjoy complex and creative machinations, but have certain subjects that will immediately make a game uncomfortable, unfun, or even downright disturbing. And you have some that can handle those subjects that make them uncomfortable, as long as it is generalized without traumatic detail.
A while back when I was experiencing issues with getting a group of players to work together (it never worked out) in Pathfinder, I made a survey designed to identify what players liked/disliked in RPGs and also what they wanted from the campaign. At the end, there was a section called, "Topics/themes that are offensive or make you feel uncomfortable", and I included the following items:
Cannibalism
PC-NPC romantic dialogue
Suicide
Gaslighting
Certain monsters
Gory depictions
Sexual assault
Bad things happening to children
Abuse
Blasphemy
Prosititution
Prejudice and bigotry
Interspecies sexuality
Bugs/Vermin
Violent murder
Now, Rabbit, aren't these often themes in D&D? Yes, many of them are, and a lot of these get a pass from most people. In the unscientific small sample that I tested (6 people - 5 men, 1 woman), 2/3's had an included at least one item. We can't draw inferences about the rest of the RPG playing population from this, but I hypothesize that there are many others out there that also might not want to play in a game with one of those elements being prominent.
Pretty much every female RPG player I met does not want to hear gruesome rape details during a game (I personally can live without it, but depending on the game, I might still play despite my comfort zone if the topic was handled seriously by the DM and group). I have had people cite not being comfortable with the topics of gaslighting, suicide, necrophilia, blasphemy, and one for "bad things happening to children". I included the last one because I previously had hobgoblin soldiers kidnap and brainwash children into becoming fanatical child soldiers for Tiamat, which fought against the PCs who were led by a Paladin of Bahamut storming an occupied palace. They nearly TPKed because the Paladin was healing the brainwashed children that were dying from party defending themselves. I told you I write dark.
What is the best rule for avoiding problems? Know your audience. You don't need a fancy survey, but kudos if you make one. Talking to your players and knowing what they expect, hope for, and their dealbreakers will go a long way for everyone enjoying a game.
What if you think, "If they don't like it, it's their problem. It's just a story"? I suppose you have the right, but usually forward advice is not just a norm, but a good idea for DMs, If you are playing a campaign where magic is always wild and unstable, shouldn't you tell the players ahead of time before they make a spellcaster? If you are playing a game with gunpowder or different technology, don't you think the players will make better character creation choices with the technological context rather than without? If you are going to be ok with PvP in your campaign, wouldn't be a good idea to let all players know that before the first indignant response to betrayal? As a player, I generally like to know what type of campaign is coming first. Without telling players important details to expect that often a character in game would know, a player can (reasonably) become frustrated, leading to unnecessary tension, conflict or even departure of players. When these frustrations arise, it generally makes the game less fun for all involved.
Whether you like asking your players how they feel about topics, it will matter in the end because you'll at least be aware of how you might alienate a player. Being informed about player preference also knows where you can get dark if you want, because "the night is long and full of terrors."