Let's see...
It is not illegal to sell a avast license as long as the seller doesn't violate the terms/conditions that avast has set for doing so.
If it was illegal affiliates/resellers are not allowed to sell them
avast also (sometimes) give a certain amount of license to e.g. (online) magazines for them to give away to their readers.
Let's say the price for avast pro is $50 a year for the consumer.
As a affiliate/reseller I get a "commission" of $2,50 for each license I sell.
The price I charge the consumer is up to me to decide.
So if I charge $48 I would "earn" $0,50 per sold license.
If I sell a license for $2,50 it would mean it is costing me $45.
But selling it for such a low price can attract (many) more customers to my store/shop who buy other things also with which I make (a lot of) money.
What customers need to check (and make sure of) is that the license is registered to their name/account and not under another name/account.