It is illegal. According to relevant public information, a trademark is an independent intellectual property that represents the source and quality of goods. The company that owns the trademark has the exclusive right to use the trademark in a specific field. If a merchant uses someone else's trademark for sale without authorization, or purchases pirated products from other merchants for sale, it constitutes trademark infringement. This kind of behavior will damage the legitimate rights and interests of the trademark owner, and also undermine the market order and consumer rights, so it is prohibited by law.