Holiday-themed cartoons were a staple of the industry for many decades, particularly Hallowe'en, but Independence Day had a few -- OLD GLORY, Chuck Jones' first Porky Pig short was released on July 1, 1939, in time for the holiday. However, this is the oldest surviving and quite possibly the oldest Fourth of July cartoon produced.
For the era, it is pretty good. Bobby and his dog, Fido, let off some fireworks and Fido gets into a fight with a foul-mouthed parrot. It won't strike modern viewers as particularly good, but given its era it is quite striking, with some good visual gags. Tom Stathes, who is doing so much to preserve and make available these rare early Bray cartoons, has posted this to Youtube ninety-five years after its premiere. It's definitely worth a look for anyone interested in the history of animation.