Sometimes — with care
Plain sweetcorn kernels are fine for most dogs — but never give a dog corn on the cob. The cob is a classic cause of dangerous intestinal blockages.
Corn itself is not bad for dogs; it is a common, digestible ingredient in many dog foods and a few plain kernels are a harmless treat. The serious danger is the cob: dogs love to chew them, but a swallowed cob (or chunk of one) does not break down and frequently lodges in the intestine, often needing surgery to remove. This is one of the most common summer-barbecue emergencies vets see. Keep used cobs in a sealed bin.
A spoonful of plain cooked or canned (no-salt) kernels off the cob, occasionally. No butter, salt or seasoning. Never hand a dog a cob to gnaw, and watch them around picnic leftovers.
Plain green beans and carrots are safer barbecue-side treats.
General information, not veterinary advice. If your pet has eaten something potentially harmful or shows symptoms, contact your vet or an emergency clinic immediately. Full disclaimer.