I think this is true. More than likely to the extent that Stan and Jack were looking at the X-Men as a metaphor for any real world civil rights struggle, rather than simply cheating on coming up with character origins and taking a page from certain current (to them) science fiction stories such as Stapledon's Odd John, Weinbaum's New Man, and Van Vogt's Slan, all of which had used the trope of a new mutant species that was going to be the evolutionary replacement for mankind (albeit without the variety of powers of Marvel's Homo superior), it was probably an analogy to ethnic and racial prejudice. Even within that context, though, given their own backgrounds and the indistinguishability of most mutants from regular humans (at least with some effort, in the case of Angel), the better parallel would have been with anti-Semitism rather than racism per se.
And even at that, it was never a very apt comparison, due to the whole lack of parental heritage thing. Black people tend to be black people because they have black parents, Jewish people tend to be Jewish based on their parents (mother only at that, if you go by the Orthodox standard), but it was decades of publishing before we first knew for sure about mutants that had mutant parents, so mutants were always by default very different from their (frequently not understanding). So later, post-Stonewall writers noticed that factor and started working in the parallels to homophobia and gay rights in more recent years.
Of course, none of these analogies, including the gay rights one, are ever going to be perfect, at least until there's a real world minority group in which individuals can actually do things like blow stuff up with their eyes or read your mind. But it's good enough to at least build some drama and even some gravitas into some of the stories.