I know that most non-jews are allowed to convert if for the right reason. Which non-jews are forbidden to convert?
All non-Jews when they convert and accept upon themselves all of the Torah's commandments ... are considered as Israelites for all matters ...
He goes on to note that for converts from four nations (Ammon, Moab, Edom, and Egypt) certain restrictions are placed on whom they and their descendants may marry, but that does not stop them from converting in the first place.
In 12:22 he discusses converts from the original seven nations who inhabited the land of Canaan, and rules that they are, in principle, like all other converts.
It is worth nothing that Mekhilta to Shemot 17:16 seems to forbid accepting converts from Amalek. However, Rambam makes no mention of such a prohibition and, indeed, Sanhedrin 96b talks about Jewish descendants of Haman, the arch-Amalekite. Thus it seems that Rambam does not subscribe to this view, and would permit Amalekite converts as well.
Bottom line, according to Rambam at least, it would seem that there are no limitations. Any non-Jew, if sincere, may convert.
Following on from my comment - I came across the following online from Rabbi Hayyim Angel who has an interesting piece here. He explores two historical issues that were a point of dispute about those wishing to convert. Namely, a non-Jewish partner seeking to get married but not necessarily with religious motivation and then following on from this the concept of conversion outside of eretz yisroel. I won't focus on the latter as I risk making the answer too long.
Some extracts are as follows:
Beginning in the nineteenth century, cataclysmic changes affected Jewish communal life. Secularization, the separation of Church and State, emancipation, and the institution of civil marriage undermined the authority of Jewish communal leadership and led to a shift from a generally traditional society to one where the majority of Jews no longer observed all of halakhah and many chose social assimilation and (increasingly) intermarriage. The latter phenomenon gave rise to the following question: If a Jew has chosen to marry (or to live with) a non-Jewish partner, and that partner applies to convert, what is the proper rabbinic response? While there is a wide range of opinions among rabbis responding to this question, they can be divided broadly into a more lenient position and a more restrictive position. This chapter will explore the central arguments of each side.
In summary, the arguments centre on what the motivation to convert is predicated on. If it is not sincerely for the sake of converting but only to allow for marriage the fallout might cause the perception that intermarriage is allowed. Morevoer,someone seeking a non-Jewish spouse suggests a less observant way of life, in which case can we allow for a convert that will likewise be less committed to the faith. Finally, can we say that a convert of this type will accept the commandments.
As such, he notes those who hold not to accept such candidates:
Several German rabbis, including Yaakov Ettlinger, Samson Raphael Hirsch, and Azriel Hildesheimer, opposed performing conversions in cases of intermarriage. They maintained that in the era when Rambam permitted such a conversion (see previous chapter), the Jewish community was generally observant. Back then, conversion to Judaism necessarily meant entry into an observant Jewish community. However, one no longer could presume that a convert would join an observant community, since the majority of born Jews no longer fully observe halakhah. These rabbis maintained that it is contrary to Torah to accept a convert who will be non-observant. Therefore, Rambam’s ruling is not relevant as a precedent in the modern era.
It is worth noting parenthetically, that this view was shared in the nineteenth century when general observance was under threat. One could ask if today in the twenty-first century, we have less of a threat, in which case we can revert to the Rambam's view, or, due to the rising rate of assimilation it is just as relevant. It would obviously require a contemporary rabbinic view to make this all clear.
He explores what if their partnership was not truly 'for the sake of heaven'. He writes:
One of the central debates between the two positions revolved around the requirement of conversion “for the sake of Heaven” (Gerim 1:3). The permissive side maintained that any choice made by the prospective convert not for personal gain should be considered “for the sake of Heaven.” A civilly married couple, then, could be considered sincere since they did not need to come to a Bet Din in order to be married. Rabbi Yehiel Yaakov Weinberg agreed with Rabbi David Zvi Hoffmann, that if a couple already lives together, a Bet Din may view their voluntarily coming to the Bet Din to mean that the conversion was not for ulterior motives. Others, including Rabbi Shlomo Kluger and Rabbi Ovadiah Yosef, maintained this view, as well.
Additionally, many who permitted such conversions did so in order to avoid the greater problem of intermarriage. A lenient interpretation of the rules of conversion was the preferable choice. Finally, the permissive side insisted that a Bet Din has a responsibility to work proactively to help people avoid living in sinful relationships.
The restrictive side disagreed. True, such a conversion may not be for the sake of marriage, but it also is not a sincere conversion for the sake of heaven. The Jewish partner, for example, may want his or her non-Jewish spouse to convert for social and communal acceptance. The restrictive side also maintained that it is not the responsibility of a Bet Din to proactively bend the rules of conversion to help sinners. Additionally, they argued, of what benefit would it be to convert a non-Jewish spouse if the couple likely will remain non-observant? Similarly, of what benefit would it be to the child of an intermarriage, who was unlikely to grow up observant? Such individuals are better off as non-Jews, since they will not be culpable for violating the Torah. Better remain a Gentile than become a non-observant Jew!