Loud outside noises like fireworks, thunder, sirens, etc. freak dogs and animals out because there is no apparent cause and effect. They're just random, and don't come from an identifiable source other than "outside." Despite the popularly repeated advice, playing fireworks noises over your stereo speakers is not going to do anything for your dog nor train him in any way what those noises are or what's causing them. Your dog isn't fooled — he knows very well you initiated the speaker noises, because he watched you do it and he's watched you make other speaker noises like TV and music the same way before. But by the same token dogs have no concept of abstract concepts so it's no good trying to explain to him that your fireworks Youtube video or whatever is supposed to be the "same" thing as what he's scared of. Because to him, it isn't.
The only thing that worked for my dog back when was making the fireworks event participatory. Just randomly subjecting them to loud bangs isn't going to do it. Take him outside to see the fireworks and stay with him, preferably with yourself and other members of your household visibly enjoying yourselves. Not coincidentally, this is also basically what you have to do with hunting dogs (and horses, for that matter) to desensitize them to gunfire.
Fireworks are especially tricky because they're usually far enough away that there's a large delay between the visual event and the noise. Trying to explain the concept of the difference between the speed of light and speed of sound to a dog is, naturally, likely to be difficult ^[citation^ ^needed]^.