Although there is no problem with a convert being a great Torah scholar, as the examples of Shmayah and Avtalyon as well as Onkelos ha-Ger and many others amply demonstrate, there may be a problem with appointing a convert as the rabbi of a community. This question is addressed directly by R. Nosson Gestetner, who concludes that a convert cannot receive the title "Rav" although he may be the one to whom the community turns to answer their questions.
R. Moshe Feinstein does not address this exact question. Nevertheless, he expresses a lenient inclination. Here is a free translation of what R. Moshe Feinstein says about whether a convert can become a Rosh Yeshiva (Iggeros Moshe YD 4:26):
The simple answer, based on the Gemara in Kiddushin 76b... and Yevamot
45b... and the Rambam Hil. Melachim 1:4... is that it is forbidden to
appoint a convert for a position of authority for Jews... But you [the
questioner] wanted to prove based on Shmayah and Avtalyon and others
[that it is permitted]--however, besides for the fact that we don't
know exactly what there lineage was [whether their mother was a born
Jew], one cannot bring a proof from them because they were the
greatest of their time...and who knows if it was not a temporary
exception [hora'at sha'ah], like the case of the prophet Devorah who
was a judge (see Tosafos Bava Kama 15a...and Yevamot 45b...) and how
can we compare our case to theirs.
But practically, one must know
that the commandment to love the convert (Deut. 10:19) obligates us to
bring them close, and to be lenient in all these types of issues.
Therefore, after much consideration, it seems that we only consider
appointments in our time to be those that have [real] authority, but
the role of a Rosh Yeshiva is to teach students who want to learn...
R. Herschel Schachter, in a responsum about women rabbis, cites Rema (Yoreh De'ah, end of siman 245) and Gra (Yoreh De'ah 245:38) that being the rabbi of a city is a position of serarah. This would mean that it would not be permitted for a convert. In the words of Rabbi Schachter:
Based on the interpretation of the Torah she’Be’al Peh, the pesukim
tell us that we may not appoint a ger to serve as King or in any
capacity of serarah, as, for example, to serve as a rabbi of a
community, or (as mentioned by the Talmud) as president of a labor
union. A ger may not serve as a dayan in a din Torah involving a
Yisrael, but may serve as a dayan in a din Torah involving other
geirim. Obviously it is possible to confer semichah on a ger,
otherwise he would not even be able to serve as a dayan for a case
involving other geirim. Although a ger may not serve as a rabbi in a
kehillah of Yisraelim, we still allow geirim to join the semichah
program in the Yeshiva and to receive semichah upon successful
completion of their studies, because years ago real semichah was
sometimes conferred on geirim.