Well, unclean ear would not affect a dog hearing however it may cause infection with severe consequences!
Some common causes for ear infection is due to bacterial, moisture or wax, ear mites and more etc.
Do ensure to clean at least 2-3 times every month! Take note of a few signs which your dog ear could be having infection.
Some signs are foul odour from the ear, redness or swelling on ear canal or discharge of pus or blood etc.