Yes, credit card funding is a legal practice that many banks and credit cards accept. Some banks will have restrictions on which credit cards they'll allow you to fund with, and some credit card companies may not allow for it, but this is at the discretion of each institution. Along with credit cards, some banks also allow for funding with prepaid gift cards.