Yes it's legal for a company or business to charge extra for someone to use there credit card.
They can add a surcharge to the price of the merchandise or service you buy when you use your credit card to cover the credit card processing fees that they get charged when taking payment through a credit card.