Our character is carrying a bag of holding. He is being grappled by a black pudding. The black pudding has done enough damage to the bag of holding. What happens to the bag and its contents?
Short Answer: Depending on the ruling by your DM, if the Black Pudding is able to dissolve the bag, then everything inside is lost forever.
This follows the disclaimer that your DM will have to make the final decision, because according to the RAW for 3.5e's Bag of Holding, and Black Pudding, there is no mention of items other than weapons or armor or clothing being dissolved by the Black Pudding's acid. Here is the exact text for the acid attack:
Acid (Ex): The creature secretes a digestive acid that dissolves organic material and metal quickly, but does not affect stone. Any melee hit or constrict attack deals acid damage, and the opponent’s armor and clothing dissolve and become useless immediately unless they succeed on DC 21 Reflex saves. A metal or wooden weapon that strikes a black pudding also dissolves immediately unless it succeeds on a DC 21 Reflex save. The save DCs are Constitution-based.
The pudding’s acidic touch deals 21 points of damage per round to wooden or metal objects, but the ooze must remain in contact with the object for 1 full round to deal this damage.
The only certainty is that the acid doesn't affect stone. However, "being able to dissolve any organic material and metal", would suggest that the cloth or leather material made wondrous of a bag of holding, would also be at risk.
The most certain part about this question, is what happens to the bag when it is destroyed. For 3.5 edition, the bag ruptures, and everything inside is lost forever. So if the pudding has in fact done enough damage directly to the bag, then that character has lost all of the bag's contents.