Are you asking for historical/genealogical reasons?
Currently:Noncitizens living in the United States may be eligible for Social Security if they: are permanent legal residents; have visas that allow them to work in the United States; or were allowed in the country under the Family Unity or Immediate Relative provisions of U.S. immigration law.Oct 10, 2018