You couldn't GET the core rules flavorless enough to make FR and DS work.
The core can easily be setting neutral enough.
It's not just Gods and subraces, things you would have to cut or change from the PHB to make it work for DS.
Core rules do well to avoid any cosmological assumptions.
Especially, religions need to be more diverse and customizable in D&D, more like Eberron - so reallife religious minorities can feel more welcome.
And religious diversity makes it more convenient to world-build homebrew settings that have special assumptions.
Barbarian: animal totem
Bard: Athas bards don't cast magic and are assassins.
Cleric: all domains but life and elemental ones
Fighter: Eldritch Knight
Monk
Ranger: all bonuses to survival and gathering supplies
Rogue: arcane trickster
Sorcerer
Warlock: all patrons
Wizard: all school specialization
With regard to classes, setting-neutral classes and archetypes make it easy to cut-and-paste the concepts that are relevant and to leave out the ones that are less relevant.
Especially the basic classes - Cleric, Fighter, Rogue, and Wizard - need setting-neutral mechanics, to plug-and-play into a diversity of homebrew settings.
With regard to Dark Sun specifically:
Athas Bard = 5e Assassin
Setting neutral assassin description, perfect.
Totem Barbarian is fine. Dark Sun has Druids who animistically venerate the plants, animals, and elements that are significant to a specific landscape feature. So a totem of an animal at that location feels appropriate in Dark Sun.
A Cleric description devoid of baked-in cosmological setting assumptions makes it very easy to reflavor official domains, and even very easy to customize new domains. The Cleric mechanics are conveniently customizable, but it is the baked-in flavor that ruins the Cleric.
Fighter is fine in Dark Sun. Wizard is fine in Dark Sun. Eldritch Knight is fine in Dark Sun. Indeed, I prefer the Eldritch Knight for the Templar. If Templar were Cleric, it makes less sense that the Templar would receive spells from the dragon-sorcerer that the dragon-sorcerer Wizard doesnt know. But the Eldritch Knight as Templar can normally learn Wizard spells from a dragon-sorcerer Wizard.
Monk as a psionic class can work well. The Shadow Monk feels awesome as a psionic mystic who engages with the Dark Sun plane of the Black.
Ranger needs a fix anyway. I have no opinion about it Dark Sun. Maybe a Scout Rogue works better. In any case, as long as setting-neutral mechanics are siloed as separate options without entangling baked-in flavor, then it is easy and useful to plug-and-play some classes and races, while leaving other classes and races out.
Sorcerer is actually one of the classes I would leave out of Dark Sun, in order to pressure the dilemma between preserving plantlife versus defiling it. On the other hand, the psionic Psychic Soul Sorcerer might be a thing, and can work well in Dark Sun.
For Warlock, I would either leave the class out, or else specifically flavor it as "Athas Elf magic", allowing fey and hexblade focusing on preservation. Still undecided, but in any case the availability of setting-neutral class mechanics helps me.
Spell names dont need to gratuitously add character names for core rules.
In sum, setting-neutral class descriptions for the core rules makes it easier to plug and play into Dark Sun flavor, ... and also into any homebrew setting flavors.
Setting neutral core rules helps ME! world build.
All subraces of dwarves, elves and halflings.
Gnomes, drow, and half-orcs
Dragonborn and tieflings
Races/species need to be far more customizable anyway. The customizability helps a player feel more comfortable about reallife concerns about ethnicity. The same customizability makes it easy for the DM to tweak it to make it more resonant for a different setting.