As far as I’m aware, there’s no specific prohibition against a Jew being head of a foreign state. As noted in the comments, we have somewhat of a historical precedent in the form of Yosef, Mordechai, Nechemiah, Daniel, and Esther. Admittedly those aren’t perfect parallels, since Yosef was before Matan Torah, all but Esther were second-in-command, and Esther was forced into the position.
That said, it’s certainly a terrible idea. To quote Avos 1:10:
שְׁמַעְיָה וְאַבְטַלְיוֹן קִבְּלוּ מֵהֶם. שְׁמַעְיָה אוֹמֵר, אֱהֹב אֶת הַמְּלָאכָה, וּשְׂנָא אֶת הָרַבָּנוּת, וְאַל תִּתְוַדַּע לָרָשׁוּת:
Shamaya and Avtalyon received [the Mesorah] from [Yehudah Ben Taba’i and Shimon Ben Shetach]. Shamaya says, “Love work, hate lordship, and do not become familiar with the government.
As the emphasized phrase is explained by the Bartenura:
וּשְׂנָא אֶת הָרַבָּנוּת. [...] פֵּרוּשׁ אַחֵר, וּשְׂנָא אֶת הָרַבָּנוּת, הִתְרַחֵק מִלִּנְהֹג שְׂרָרָה עַל צִבּוּר, שֶׁהָרַבָּנוּת מְקַבֶּרֶת אֶת בְּעָלֶיהָ:
“Hate lordship” [...] Another explanation: “hate lordship” - distance yourself from acting with authority over the community, for lordship buries those who have it.
וְאַל תִּתְוַדַּע לָרָשׁוּת. כְּדֵי לִטֹּל רַבָּנוּת עַל יָדֶיהָ. אִי נַמִּי, אַל תִּתְוַדַּע לָרָשׁוּת, שֶׁלֹּא יַעֲבִירוּךָ עַל דַּעַת קוֹנְךָ, כְּמוֹ שֶׁאֵרַע לְדוֹאֵג הָאֲדוֹמִי. לָרָשׁוּת, הַשְּׂרָרָה קְרוּיָה רָשׁוּת, מִפְּנֵי שֶׁהָרְשׁוּת בְּיָדָהּ לַעֲשׂוֹת כִּרְצוֹנָהּ:
“Do not become familiar with the government” to take lordship through it. Alternatively, “do not become familiar with the government” so that it does not cause you to violate the will of your Maker, like what happened with Doeg HaEdomi. “With the government [lit. ‘permission’]” - dominion is called “permission,” as permission is in its hands to do as it wants.
Further on, in Avos 2:3:
הֱווּ זְהִירִין בָּרָשׁוּת, שֶׁאֵין מְקָרְבִין לוֹ לָאָדָם אֶלָּא לְצֹרֶךְ עַצְמָן. נִרְאִין כְּאוֹהֲבִין בִּשְׁעַת הֲנָאָתָן, וְאֵין עוֹמְדִין לוֹ לָאָדָם בִּשְׁעַת דָּחְקוֹ:
Be careful with the government, as they only draw a person close for their own needs. They appear like lovers in beneficial times, and they don’t stand for a person in the time of his trouble.
All that said, consider the Tosfos Yom Tov to this latter Mishnah, quoting Midrash Shmuel quoting the Rashbatz:
הוו זהירין ברשות וכו'. כתב הר"ב אע"פ שאתם צריכים להתוודע לרשות כדי לפקח וכו' דעל כיוצא בזה לא אמר שמעיה [בפרק דלעיל משנה י'] כי זו מצוה רבה היא להתוודע להם לפקח על עסקי צבור ומרדכי ורבינו הקדוש יוכיחו. מד"ש בשם רשב"ץ:
“Be careful with the government, etc.” - The Bartenura wrote, “Even though you need to become familiar with the government in order to supervise [communal needs, be careful, etc.]” Shamaya (above, 1:10) was not discussing such a case, for this is a great Mitzvah to become familiar with them to supervise communal needs, as Mordechai and Rabbeinu HaKadosh [Rebbi Yehudah HaNasi] prove.
(Incidentally, Rebbi Yehudah HaNasi’s son Rabban Gamliel is the one who taught this Mishnah, as per the opening line of Mishnah 2.)
Seemingly, then, as long as one makes absolutely, positively sure his priorities are straight - that he’s acting solely for Hashem’s sake, that he’s fulfilling the Mitzvah of helping out his fellow Jews, that he doesn’t become corrupted by the power of the office, etc. - perhaps there is room to say it’s fine. But it still seems to be heavily discouraged.
In a similar vein, consider Horayos 10a:
וינגע ה' את המלך ויהי מצורע עד יום מותו וישב בבית החפשית ויותם בן המלך על הבית (מלכים ב טו, ה) מדקאמר בבית החפשית מכלל דעד השתא עבד הוה
“And Hashem struck the king, and he became a Metzora until the day of his death. He sat in the Freedom House, and Yosam son of the king was over the house” (Melachim 2:15:5). From that it says “in the Freedom House,” it implies that until then he was a slave [i.e. to his people].
As Rashi spells out on the final line:
מכלל דעד השתא עבד הוה - דשררות עבדות הוא לו לפי שמוטל עליו עול רבים:
“Implies that until now he was a slave” - for dominion is slavery to him, for it places on him the yoke of the public.
TLDR: Is it a good idea? Probably not. Is it permissible? Yes, as long as you keep your priorities in check.