Yes, it is possible to obtain a personal loan or credit in Germany as a foreigner. This counts for expats as well as students. You do however need to have a residence in Germany and need to be registered here ("Anmeldung" or "Meldebescheinigung").
The required qualifications include a fixed monthly income, a clean credit history ("SCHUFA") as well as proper identification and ability to pay back the loan.