Yes, but any ATM tells the bank that you took out $10. The bank never sees the cash and the cash doesn’t belong to the bank. Substituting goods may or may not be allowed but the bank doesn’t know about it and customers are unlikely to complain to the bank.