it is literally just making up a story with your friends any prejudice in it is brought by the people at the table not inherent to the form
what you're describing is 'roleplaying'. dnd is a product with a rulebook and five editions, all of which have lists of 'races' (dnd still calls them races, for fuck's sake, terminology even the dnd-adjacent pathfinder has moved past) that you can pick from--that, for the overwhelming majority of the game's 50-odd year history, have come with biologically inherent differences in culture and capability. the rules of dnd fifth edition tell you that elves are inherently more intelligent than other 'races'. that's in the rulebook! so is a bunch of other worse stuff!
you can bring anything you want to your table, you can ignore and throw out the race essentialism, a lot of people of colour have historically put a lot of unpaid labour into making supplements and rule change options that let you remove or avoid it! but as they come in all official material, the rules and world of dungeons and dragons are lousy with racist tropes that the entire fantasy genre badly needs to move past. this article is a good primer if you are genuinely interested in learning about the history dnd has with racism wrt the fantasy genre. so's this one. so's what nk jemisin has to say about it. if you deliberately close your eyes to the racist tropes in the culture around you, you're going to end up perpetuating it.