Strictly speaking, it is illegal.
The so-called tail order refers to the portion left or detained due to excessive production volume (exceeding the customer's required quantity) or customs reasons, as well as the portion with slight defects in the production process.
1. For consumers: If they buy at the price of the genuine product and don’t know it is the last order, then it is obvious that you are deceiving consumers and selling fake products. Because after all, the last order is not a genuine product sold in an authorized store.
2. To the trademark owner: you have violated the brand’s trademark rights. For example, Nike requested to produce 1,000 pairs of shoes, but the manufacturer produced 1,200 pairs, which is 200 pairs more. Only the 1,000 pairs delivered by the manufacturer are the shoes that Nike sells on the market. Those 200 pairs cannot use Nike's trademark unless authorized by Nike.
But they are generally sold now, and there are quite a few on Taobao. As long as the price is reasonable and the quality is guaranteed, no one will probably care too much.
Personal opinion. For reference only.