Myiasis is a fancy medical term for a really gross condition: an infestation of maggots. Sometimes they will even begin to eat the healthy tissue.
Diagnosis and Treatment
Myiasis is diagnosed by the presence of maggots on the skin, in the coat, or in the wound of the dog or cat. Treatment consists of shaving the hair and removing in maggots, topical wound treatment and usually several weeks of oral antibiotic therapy. Some types of myiasis, such as a Cuterebra infestation, requires surgical removal of maggots. Once the maggots are removed, the underlying skin infection or other cause of infestation should be treated.
The best way to prevent your pet from becoming a home for maggots is to make sure that any wounds are kept clean and that underlying skin problems are treated. Because weak and debilitated pets are more susceptible, it is important to keep them inside as much as possible and to make sure to check their coats frequently for urine and/or feces. Any urine and feces should be washed off of your pet’s coat daily.
If you have any questions or concerns, you should always visit or call your veterinarian – they are your best resource to ensure the health and well-being of your pets.
Should I Be Worried If My Dog Ate Maggots?
What should you do if your dog ate maggots?
Maggots, white and squirmy, are simply the larvae of flies such as houseflies and blowflies. Even though they bear resemblance to more harmful parasites like roundworms and tapeworms, maggots by themselves are usually not dangerous.
As disgusting as it sounds, they are actually rich in protein!
The acid in your dog’s stomach is typically strong enough to combat any ill effects from live maggots, unless of course if your dog ate a huge amount. In that case, your dog may experience stomach pain and vomiting when trying to digest the larvae.
However, the one thing to consider is what the maggots were eating before getting eaten by your dog.
Maggots are often found on rotten meat or spoiled food ripe with bacteria. Obviously your dog could experience health issues if it eats maggots with that harmful bacteria inside them.
Maggots are also commonly seen on animal excrement outside. Many dogs have a condition called coprophagia, where they find poop particularly…appetizing.
If the maggots were on or inside poop, you should contact your vet to get a deworming prescription. Animal feces can contain worms and their eggs, of which your dog will ingest alongside the maggots.
The most serious issue that maggots could pose is not from your dog eating them, but by them merely being in close proximity. Myiasis can occur if a dog has cuts or wounds and flies or maggots are able to latch on.
"Maggot" is not a technical term and should not be taken as such in many standard textbooks of entomology, it does not appear in the index at all.   In many non-technical texts, the term is used for insect larvae in general. Other sources have coined their own definitions for example: "The term applies to a grub when all trace of limbs has disappeared"  and "Applied to the footless larvae of Diptera".  Additionally, in Flies: The Natural History and Diversity of Diptera, the author claims maggots "are larvae of higher Brachycera (Cyclorrhapha)." 
Maggot-like fly larvae are of wide importance in ecology and medicine among other roles, various species are prominent in recycling carrion and garbage, attacking crops and foodstuffs, spreading microbial infections, and causing myiasis. Maggots are also particularly important in forensic entomology because their development can help determine the time of death, particularly maggots in the Calliphoridae family. 
Anglers use maggots usually provided by commercial suppliers to catch non-predatory fish. Maggots are the most popular bait for anglers in Europe [ citation needed ] . Anglers throw handfuls into the "swim" they are targeting, attracting the fish to the area. The angler then use the largest or most attractive maggots on the hook, hoping to be irresistible to the fish. Commercial maggot breeders from the UK sell their maggots to tackle dealers throughout the E.U. and North America.
In North America, maggots have been used primarily as ice fishing bait recently, however, anglers have started using them year-round.
Medical treatment Edit
Live maggots of certain species of flies have been used since antiquity for wound debridement. (Use of the wrong species would invite pathological myiasis.  ) In controlled and sterile settings overseen by medical practitioners, maggot therapy introduces live, disinfected maggots into non-healing skin or soft wounds of a human or animal. The only maggots cleared for marketing in the United States are larvae of Calliphorid flies of the species Phaenicia sericata (formerly known as Lucilia sericata).  This species of maggots is most widely used in the world as well but it is unclear whether it is the only species cleared for marketing outside of the United States. They feed on the dead or necrotic tissue, leaving sound tissue largely unharmed. Studies have also shown that maggots kill bacteria. There are three midgut lysozymes of P. sericata that have been shown to show antibacterial effects in maggot debridement therapy. The study demonstrated that the majority of gram-positive bacteria were destroyed in vivo within the particular section of the P. sericata midgut where lysozymes are produced. During the passage through the intestine of the maggots, the ability of bacteria to survive drastically decreased, implying the antibacterial action of the three midgut lysozymes.  As of 2008, maggot therapy was being used in around 1,000 medical centers in Europe and over 300 medical centers in the United States. 
Forensic science Edit
The presence and development of maggots on a corpse are useful in the estimation of time elapsed since death. Depending on the species and the conditions, maggots may be observed on a body within 24 hours. The eggs are laid directly on the food source, and when the eggs hatch, the maggots move towards their preferred conditions and begin to feed. By studying the insects present at a crime scene, forensic entomologists can determine the approximate time of death. Insects are usually useful after a post-mortem interval (PMI) of approximately 25–80 hours, depending on ambient conditions. After this interval, this method becomes less reliable. Blow flies are often used in forensic entomology to determine PMI because of their oviposition on carrion and corpses. The black blowfly, Phormia regina (P. regina), is extremely widespread across the US and often the earliest species to oviposit on a corpse, making it especially important to forensic science. 
As with fleas and ticks, maggots can be a threat to household pets and livestock, especially sheep. Flies reproduce rapidly in the summer months, and maggots can come in large numbers, creating a maggot infestation and a high risk of myiasis (a maggot infestation of living tissue) in sheep and other animals. Humans are not immune to the feeding habits of maggots and can also contract myiasis. Interaction between humans and maggots usually occurs near garbage cans, dead animals, rotten food and other breeding grounds for maggots.
When maggots turn into adult flies and start the life cycle over, numbers will grow exponentially if unchecked, but disease, natural predators and parasites keep the population under control. Sealing garbage and using a garbage disposal or freezing rotting leftovers until waste collection day helps prevent infestation. Introducing an environmental control, such as Hister beetles, can also help reduce maggot populations.
So, this question depends on the severity of the Myiasis and how much deep tissue has been damaged, so I will give you a broad answer, that may help you and others in the future. Usually a bacterial infection spreads quicker than the rapid spread of the larvae, and bacterial infection can definitely kill an animal. If your vet has said he/she thinks treatment is the best option for your pup (versus being in too much pain, too much suffering, or too far gone thus suggesting euthanasia) then I would try my best to keep the faith in his educated opinion.
Since I don't have pictures, or am able to see a blood panel test, or blood/tissue culture to see what type of infection or bacteria is growing and how the body is reacting- I would suggest IF you are concerned enough you could always get a second opinion from another vet. Subcutaneous infections can get into the bloodstream, spread to the spine, brain, other organs etc. I have seen a dog go blind from Myiasis from the location of where the infestation and infection took place. I would take this seriously either way, no matter the severity, because even if "death" (as you asked) isn't the outcome, there could be other outcomes that affect your pup forever. I would try your vets treatment plan.
You did the right thing by taking him to the vet after topical solutions didn't work.