Sure. But would those changes always remove the less savory aspects of authentic human existence? Fantasy racism is still a thing, for example.
It might.
Take a look at the real world. Women's rights got a big boost after the World Wars, because women had to join the workforce and many of them didn't want to go back to being homemakers after that. That gave women more financial independence, which allowed them more freedoms and the ability to control themselves.
Now imagine a fantasy world where humans have been at war with, say, orcs, for a very long time. Or with elves, or with demons, whatever. Or simply a fantasy world where travelers get eaten by random encounters willy-nilly so going from one city to the next is particularly deadly. If men are the ones doing the fighting or long-distance trading, then eventually women will gain the same sort of freedoms.
Then, imagine a fantasy world with active gods. It's one thing to believe in a god that believes in peace and justice and another thing for that god to manifest in the town square to prevent a racially-motivated attack, or yanking the spells away from a bigoted priest or paladin. Imagine a god of love deciding to smite a homophobe.
Then, imagine a fantasy world with magic. Sure, men may decide that women or people with a particular skin color aren't allowed to learn wizardry. But that won't stop women from being born magical, or from being chosen by a god, or even from making a deal with an eldritch being. And, well, The Nine Hells hath no fury as a women scorned who also knows how to cast
fireball.
Now imagine that all of this happened in the past. Most fantasy worlds have hundreds or thousands of years of history. Even if the gods never manifest anymore, they likely did in the past. Even if humans hadn't been to war in ages, they were in the past. And then those changes get built on. And decades or centuries later, sexism, homo/transphobia, and racism are rare or at least highly frowned upon.
And
then remember that there's
no reason for most of this bigotry to exist in your world in the first place. Unless you are actively gaming in 8th-century Europe, there's no reason why you would need to have real-world 8th-century European values in your game. Many real-world cultures were not very sexist or homophobic. Use elements of those cultures as the basis for your campaign. And as for racism, well, as the late great Terry Pratchett said, "black and white live together in harmony and gang up on the green."