To obtain a credit card in the United States, it is not necessary to be a United States citizen.
Legally, the immigration status of a person is not a requirement for the processing of a credit card. Although some banks require the SSN, other banks accept credits to users with ITIN (Individual Taxpayer Identification Number).
The first step to think about obtaining a credit card in the United States as an immigrant or even as a student, is processing the ITIN. Through this number, banks can verify your identity, this would normally be done through the SSN, however, only citizens, permanent residents and non-immigrant workers have one.
You can process your ITIN through the Internal Revenue Service (IRS), by filling out a W-7 form. For this, it is necessary to prove your identity either with a passport, identification of your country of origin or visa issued by the State Department. You can consult more information about this process at the following link: https://www.irs.gov/es/individuals/how-do-i-apply-for-an-itin
Although most card issuers accept SSN, ITIN or passport to obtain a credit card, another important point to be approved is your credit history.
For immigrants who have just arrived in the United States, it is difficult to obtain credit for this, they must gradually build their credit history. And before applying, it is suggested that a person with a better credit score sign the credit application together with the applicant, in this way the bank will run less risks and could provide an easier credit card.
On the other hand, there are also some companies that retrieve credit reports from immigrants in their countries of origin and translate them into the equivalent in the United States.