No, unless you are in Hong Kong.
Bank self-service machines in mainland China can only recognize RMB, not Hong Kong dollars. If you have spent Hong Kong dollars with a credit card, you can self-exchange RMB for repayment.
In China, all foreign currency deposits and withdrawals must be handled at the counter, and original ID cards are required. You can do it on your behalf, but you need to bring 2 original ID cards.