Eyelid swelling in dogs can be due to many reasons. If eyelid swelling is sudden then it usually goes away at its own very fat. You should look inside the eye of your dog to see anything stuck inside the eyelid. You should wash the eyes of your dog with saline solution. If there is any infection in the eyes then use warm compress for 3-4 times in a day. Use of anti allergy medicine will also help. Wait for 24-36 hours and In case of no improvement visit a vet.
Put warm then cool compress on them see if they go down, if not could be allergies or infection,does he have discharge or injury? Take him to the vet. Best wishes