Depends on the vegtable... and the dog
Many dogs will snitch tomatoes and grapes - grapes are dangerous, if your dog's in that habit, it needs to be controlled. I've heard of dogs eating sugar snap peas off the vine. OTOH, I can't imagine any dog chowing down on a pumpkin or corn. Some dogs show no interest whatsoever. If you see your dog sampling, you could try spraying a deterent. Do you remember Binaca breath spray? My dog trainer swore up and down that blue Binaca was the best dog deterrent in the universe. Only the blue stuff, not the other varieties. She sent us all to Target to buy it, since she said not many places carried it.