I had wondered " do dogs feel pain when they are put to sleep?" and I think I figured out the answer. After personally observing, attending +comforting family dogs during the Euthanization process, interviewing veterinarians and pet loss experts I would guess that the pain is mostly felt by the pet parent. Your dog will usually be sedated first and then injected with drugs like Pentobarbital (Seizure med)
in a high dose which very quickly renders them unconscious and stops their heart and brain function in a minute or two. (not sure what drug they are using these days) This type of Euthanization
is considered humane by Veterinarians but I have not checked if any studies have been performed to determine if pets feel pain during this process.