The legions, both in the Republic and in the Principate, were made up of Roman citizens. During the Imperial period, the legions were increasingly made up of non-Italian soldiers (ie from Africa, Spain, Gaul, etc), but they were still drawn from provincial cities which had Roman citizen status. Non-citizens joined the Roman army via non-citizen auxiliary forces. If they served a set number of years with distinguished service, they were awarded citizenship by the Emperor. This was marked by a little ceremony and a bronze plaque commemorating the event, called a diploma. We have a few dozen surviving examples of diplomata and about ten thousand additional modern forgeries sold on sketchy websites to hapless collectors.
During the Republic, before the legions were standardized by Augustus, the rules were a little more loose and during a crisis, it was possible that non-citizens could find their way into the legions, especially non-citizen Italians. So during the Gallic Wars, Caesar enrolled a lot of "Transpadines" (ie non-Romans living across the Po river), who turned out to be very effective legionnaires. They had "Latin rights," a sort of grey area between citizen and non-citizen. After Augustus, the legions were more or less fixed and the creation of new ones was relatively rare, and so the enrollment of large blocs of non-citizens had many fewer situational opportunities. By the time we get to Caracalla, the issue of "Roman citizen" vs non-citizen is beginning to lose importance, leading to his "Edict" in 212 CE which granted citizenship to all free male inhabitants of the Empire, from Egypt to Britain, from Morocco to Syria.