Yes if a dog has intestinal worms and the worms aren't killed off or the dog is left untreated for the worms then the dog could die within a few weeks to a few months depending on how bad the dog has the worms.
The dog should be given worm medicine at least once per year and you should take your dog to the vet to get a heartworm test and a fecal examination done to find any worms that may be in your dogs intestines.
It's better to catch the worms early so the worms can be killed off before the worms have a chance to eat the dogs intestines completely and kill the dog.
Preventing the heart worms and other worms inside your dog is the best thing to keep your dog healthy and alive.