Is a Jew allowed to enlist in the army (outside of Israel)? Assuming that kosher concerns can be taken care of, there are still serious issues of Shabbos violations, among other things.
In volume 4 of Bnei Banim (link), R. Yehuda Henkin published a letter from his famous grandfather, R. Yosef Eliyahu Henkin, to his son (and R. Yehuda Henkin's father) on this issue. During World War II, Dr. Avraham Hillel considered enlisting in the US army and asked his father, R. YE Henkin, for advice. R. Henkin responded as follows (pp. 93-94):
In my view there is a distinction between the army rules that used to be in America and England, and the current obligations to the army. In the past, when the entire army was voluntary, and during war they would announce and call for volunteers based on their emotions and dedication to nation and land -- then everyone was certainly required to accept this responsibility. But now that there is an obligation for this work [i.e. a draft] -- I don't see why one should volunteer to go. Through this, one will only exempt someone else because there is a limit to the army...Perhaps more to the point, R. Yitzchak Herzog writes the following in an essay published in Techumin 4/1983 (pp. 14-15):
The question is when there is no draft but the government request volunteers from the people, like in Britain at the beginning of World War I.
On this there is not only the question of placing oneself in danger to be killed, or the question of killing... but also of violating Shabbos and eating non-kosher food and chametz on Pesach. And even if we can fully arrange the matter of kosher food -- if all the Jews in the country request it, they can work with the government to make sure there is kosher food -- but it is impossible to avoid violating Shabbos and Yom Tov. However, once one is in a battle there is piku'ach nefesh and, additionally, [even before] then one is forced by the government since the volunteer from the time he enlists is under the full obligation of the army and cannot fail to violate Shabbos and Yom Tov... The question is whether one is permitted to bring oneself into a situation of such duress.
Regarding the actual law of violating Shabbos we should investiagte whether he is violating Shabbos on a biblical level, because the view of the Maharik (137) is that when gentiles threaten our lives if we do not violate Shabbos then one does not violate on a biblical level because it is a melakhah she-einah tzerikhah le-gufah... However, one can also say that if all or most Jews, relying on their religion that prohibits violating Shabbos, fail to volunteer, then this will also endanger all Jews in that country, perhaps in the whole world, because they will say that Jews are not loyal to their government and are a danger to the country's existence. See Responsa Mitzpeh Aryeh from the genius of Lvov who permitted a Jewish doctor to violate Shabbos to save endangered gentiles for this reason.
In addition to that viewpoint we arrive at the dispute between the Ramban and Razah if one is allowed to place oneself in a position of duress regarding the violation of Shabbos, which the Razah permits in a mitzvah situation and based on this it is ruled that one may join a caravan into the desert and a boat, even if one knows that they will need to violate Shabbos because of piku'ach nefesh... Therefore we can say that preventing bad things from the Jews and a denigration of the Jewish name among the nations is also a mitzvah, a great mitzvah, even if we do not wring (נמצה) the matter all the way to piku'ach nefesh for the entire Jewish people. Therefore it is permissible to enlist, and once he volunteers he is under duress because of piku'ach nefesh.