I once received an item, where the seller placed it in a plastic bag, and tried to fill the rest of the box with foam-in-a-can insulation / sealant.
As I recall, it did not work as well as he expected, but was OK.
I think that the trick would be finding the right kind of foam. Something that expanded to fill large volumes (some of the window seal stuff won’t), but won’t expand and blow the cardboard box apart.
Philbert