What kind of worm is white and flat and is coming out a dog's butt?

I believe it's called a tape worm. You need to get the dog to a vet. They will treat him for worms and probably give you something to give to the dog at home. It is possible for animals to die of worms if not treated. yes its a tapeworm, you can treat it with the wormers you find at your local supermarket just make sure you adjust the dose for the wieght of the dog ..the dosage isnt universal I do believe that would be a tapeworm (tapeworm segments to be exact). In any case, you should bring the dog to a veterinarian. There the dog can be tested for any other intestinal worms it may have that cannot be physically seen, and it can be treated for any and all worms with a quality dewormer on a specific schedule over a period of time. I have never heard of dewormers being available at the local supermarket, but even if they are there you shouldn't trust them.