Service fees, also called convenience fees, can be charged by eligible merchants in Canada on specific types of transactions. They cover the costs of processing a debit or credit payment and are usually charged as a fixed cost (for example, $2.50 for all payment networks). Eligible merchants usually include businesses who typically wouldn't accept debit or credit, and ATM operators if you don't belong to their network.
Surcharges are different than service fees. Merchants may charge them because you use a premium credit card that may cost the merchant a higher processing fee or because you use a specific payment network, such as American Express.
Charging a surcharge is not currently legal, however this may change as Visa and Mastercard reexamine interchange rates every few years. The most recent changes came into effect in the summer of 2020, with rates staying close to what they were previously.