Certain antibiotics can cause deafness if used in an ear that has a ruptured ear drum. It is also possible that the infection caused the hearing loss if it went into the middle ear, this can be caused by too vigorous flushing/cleaning, cleaning with q-tips etc. It's also possible that the ear canals are so swollen. It's a bit weird that both ears are affected. Unfortunately to really test hearing you are going to need to see someone with special equipment like a neurologist. Hopefully it's just secondary to inflammation etc or too vigorous flushing and will return over the next few days. Another thing is that if you are putting a lot of meds/cleaner in the ear it could be physically obstructed causing hearing loss but not total deafness. Is the dog hearing anything at all?