The balloon doesn’t make the sound. The immediate change in air pressure from what ever it was in the inflated balloon to the ambient air pressure creates a pressure spike that is perceived as a sound. If the air pressure surrounding the outside of the balloon where the same as the air pressure in the balloon, when the balloon surface was punctured there would be no spike in air pressure and thus no sound.
Thunder is the sound produced during the electric discharge of a lightning, while elecrticity is passed through the surrounding air gets vibrated . As a result of sudden expansion and contraction of the air particles, results in a loud sound known as the thunder. The balloon popping is also an instance of such a phenomenon.
In both the cases the surrounding air particles vibrates to cause the sound.