Look up retconning. It's used all the time, especially to change a character's race.
And no, the X-Men were not based on black people. They are based on anyone who is the victim of prejudice. And this may come as a shock to you, but black people are not the only victims of prejudice, or even the worst. As far as hate crimes go, black people are in fourth place, per capita. Behind Gays, Jews and Muslims. Blacks haven't been the leading victims of hate crimes since 1993. https://www.latimes.com/archives/la-xpm-1994-05-10-me-55932-story.html
However, they are the leading perpetrators of hate crimes, per capita. 13% of the population commits over 21% of all hate crimes. https://www.justice.gov/hatecrimes/hate-crime-statistics
As for the X-Men, they've fluctuated over the years, but these days they're based on gay people. Think about this: genetic mutation emerges at puberty. Gee, what else emerges at puberty? Could it be sexual orientation? Race pretty much asserts itself in utero, and based on the race of the parents, we already know what to anticipate.
But have fun with your made up facts.