Here is what a medical website says about that:
"Doctors aren't yet entirely sure how Vicodin causes hearing loss. One theory is that the opiates damage the delicate hair cells inside the inner ear, which act like tiny microphones to transmit sound vibrations to the brain. The effect also may involve nerve endings in the ear called opioid receptors, which are sensitive to overstimulation."