It depends on what type of card you have.
If it is one discount per card, it depends on whether the corresponding passbook is a multi-currency account. If you have a multi-currency account, you can deposit foreign currencies, but if you have a single-currency account, you can't. For a single-currency account, you only need to go to any branch to switch to a multi-currency account.
If it is an E-era card or a wealth management gold card, the card itself is a multi-currency account, and you can directly deposit foreign currencies.
If it is an international credit card, it depends on which currency you choose when applying. There are now three types of RMB+HKD; RMB+USD; RMB+EUR