I would guess that many fish have not survived being shipped when not done properly or with some forethought. I know I have received fish that didn't make it during shipment. Not a nice thing to happen.
Some people will use FedEx Priority overnight and only ship on certain days of the week so fish are not left sitting over the weekend or over a holiday. They will double bag the fish, some bags will have square bottoms. The boxes are insulated and bubble wrap and other materials are used to cushion the box and to make a secure fit. The fish are prepared a head of time by fasting them for several days.
Depending on where or who you buy from they should explain their own procedure. And when receiving fish by mail it would be a good idea to be home to be able to accept delivery and get them out of the box and into their new tanks.
I have had bettas, guppies and bn pleco shipped but never a goldfish.
I have been watching Ken Fischer (DandyOrandas) auctions and would really love to get one or two of his goldies. Just not in my budget at this time but maybe some day....If you go to his website you can see where he explains how they ship their fish.