Yes, you can legally buy unclaimed Amazon and USPS packages. Here's how – CNET

Tons of unclaimed packages never make it to their rightful owner, and you can grab them. Just watch out for scams.
You can buy lost or misplaced packages from auctions.
Do you know what happens to Amazon and US Postal Service packages that never make it to your doorstep? While your first guess may be porch pirates, your items could’ve been lost in transit from one delivery truck to another or misplaced in a warehouse. After months of going unclaimed, those packages can be auctioned off or end up for sale at local swap meets. (Amazon typically refunds customers or replaces missing items.)
A few TikTok creators have brought the idea of buying lost packages to light, posting videos of warehouses full of mystery items waiting to be unboxed. While some contain cheaper fare like socks, TikTokers have also unwrapped gift cards, Nike sneakers and name-brand purses. Postal Service auctions put some items on display before you buy, so you have an idea of what you’re getting.
We’ll explain how to purchase unclaimed packages from Amazon, US Postal Service and other delivery services that haven’t been claimed. We’ll also tell you how to look out for companies that claim to sell mystery boxes but could potentially be scamming you.
If a Postal Service package hasn’t been claimed within 90 days, it’ll likely be auctioned off on GovDeals, a company the US Postal Services contracts with to sell unclaimed items. Items could be sold in lots, rather than individually — so you may wind up with a bunch more stuff to sift through, resell or donate. On the site, you can browse categories you are interested in — for instance, sporting equipment, beauty supplies and clothing.
The website Liquidation lets you choose the company you’re interested in buying bulk packages from, including Amazon, Target, Walmart, Lowes and Home Depot. For some items, you can actually see what you’re bidding on, but other listings will only show you images of the boxes or pallets and the category it falls under, as well as an estimated retail price. 
Note that depending on the size and weight of the items you get, you can expect shipping to be upwards of $100. 
If you’re looking to buy items that were never delivered, you can search for vendors in your area to see if there’s a local swap meet or other places that sell undelivered items. Websites like Swap Madness can help you identify a vendor that could have packages for sale — for instance, a flea market stall.
Note that some days may be better than others for finding packages. For instance, a TikToker visited Treasure Hunt in Evansville, Indiana, after it had just been restocked with packages and found a vast amount of items for purchase. A reporter from Business Insider visited the same store on a weekday right before the store restocked and found everything picked over. 
If you’re planning to travel several hours to go to one of these stores, we recommend calling ahead to find out when shipments are scheduled to arrive.
TikTok users have found packages as low as $1 each.
Unless you can see exactly what you’re buying, you may run the risk of purchasing items that aren’t valuable to you. What you want to avoid is putting money in the hands of someone who gives you nothing at all.
We suggest checking the Better Business Bureau website and reading customer reviews to make sure the seller is legitimate. One company I found on the BBB site had reviews from customers who reported not receiving their packages after many months, and getting fake tracking numbers.
For legitimate sellers and sources, we recommend going through sanctioned unclaimed package auctions, like GovDeals.
FedEx has a different method for unclaimed packages. If the package is undeliverable, it will place the package in temporary storage, like a warehouse, or dispose of the shipment “in accordance to local law.”
UPS doesn’t specify on its site what it does with packages that go unclaimed, although some Reddit users say the large delivery company does send the items to be auctioned.
For more deals, here are some cool gifts you can buy for under $50. Also, this Amazon hack could save you hundreds of dollars year round.