Hi there,
Legally speaking, it is possible to open an account (like a credit card account) in Germany as a non-resident, provided you can prove your identity. This can be done at a Deutsche Post office in Germany via Postident certification, for example.
However, banks usually perform a credit check when you apply for credit-based products like credit cards. In Germany, your credit report from the SCHUFA credit bureau is used for this purpose. Unless you have lived in Germany at some point, you will not have a SCHUFA credit record.
Some German banks which used to willingly take on non-resident customers have largely changed their policies, and now cater only to residents of Germany. Each bank has its own policy, so the best thing you can do is to phone the bank and ask them directly about their non-resident policies.
Best regards from Moneyguru
More on this topic:
Swiss credit card comparison