The Hans Christian Andersen tale centered on a magic tinderbox and three dogs is The Tinderbox.
The story follows a soldier who meets a witch after returning from war. She sends him into a hollow tree to retrieve a tinderbox guarded by three increasingly enormous dogs. The soldier keeps the box, uses its supernatural power, and eventually gains wealth and royal status.
The Tinderbox was one of the four tales in Andersen’s first collection of fairy tales, published in 1835. Unlike some of Andersen’s most famous stories, it draws strongly on Scandinavian and European folk-tale motifs, including magical objects, underground treasure, and animals with extraordinary eyes.
The three dogs are distinguished by their oversized eyes and increasing strength. Readers sometimes confuse the story with The Flying Trunk, another Andersen tale involving magic and travel, but that story’s central object is a trunk rather than a tinderbox.