NativePet.com has a good explanation:
"Adding pumpkin to your dog's diet can benefit your four-legged friend in a variety of ways. Feeding pumpkin can give your dog a little nutritional boost, help with digestion, and aid in weight control. ...
Feeding your dog raw pumpkin really isn't worth the risk of choking. Don't feed your pooch raw pumpkin flesh or the skin or stem of the gourd. Plain canned pumpkin is more nutritious anyway, because it's less watery than fresh pumpkin.
However, canned pumpkin is very different from pumpkin pie filling. ...
Only feed your dog plain canned pumpkin to play it safe. Avoid canned pumpkin with additives like sugars, spices, or fillers, as well as sugar-free pumpkin. Be careful not to give your dog pumpkin pie filling, either. And, of course, never feed your dog pumpkin pie itself.
...feed your dog pumpkin in small amounts. Whether it's plain canned pumpkin or a homemade pumpkin puree, give your dog 1-2 small teaspoons at a time, perhaps over top of their normal dog food."
Always check with your vet if you are uncertain about feeding your dog pumpkin or any other new food.