First, underestimation of shipping.
There is no reason for a quote to be grossly inaccurate if you have original packaging. You have the weight and size of what is to be shipped and online calculators are available from the shippers. In view of this, if my quote is too low, it is likely to be miniscule and I will absorb the difference.
On the other hand, if the shipment requires that you package with new shipping materials as you do not have the original, there is more time and effort involved, and a greater likelihood of error. In this case, if the underestimation is more than a couple of bucks, I would go back to the purchaser in advance of the shipment and explain why shipping will be be higher and request an adjustment of price. I will offer to cancel the transaction if the purchaser is unhappy about the unforseen development. They will know that you're not lying or using a trick to get out of a transaction because they can confirm the price on an online shipper's calculator with the weight and dimensions that you supply to them. They would also see the price of shipping on the shipping invoice when they receive it. I think this is a proper, businesslike approach. Still, even if this is a proper business aproach, this is a bit uncomfortable on a personal level and there is a certain feeling of community here on AudiogoN. So I would try to avoid this and be careful not to give shipping estimates until I knew for sure what they would be. By the way, the potential abuse of this latter approach is one of the reasons why many jurisdictions have laws requiring people to charge no more than their original estimates in a commercial setting.
Now, how about the other way around,what if I overestimate.
If I overestimate, no matter how small it is, I send the difference back to the purchaser without solicitation. The goodwill to your reputation far exceeds the couple of bucks of gas money. In fact, the smaller the amount, the more upstanding it makes you look. And the extra money is not something you were expecting anyway, so no loss to you.
Now on the issue of shipping costs, let me tell you what made me livid once. Every once in a while I need a good rant. I requested a shipping estimate via a specific method of shipping with a specific company. The seller sends the quote. I verify it with the online shipping calculator, confirm and send the seller the money. The seller then sends via a different, cheaper method than what I specifically requested and paid for. It was even with a different company. He then pocketed the $100 difference in his favour.