Dogs howl when they hear music because of their natural instinct to join other animals in howling, suggests Modern Dog magazine. They associate musical notes with the howls of their peers, so they join the chorus.
In the wild, dogs and wolves that howl often make an effort to strike a different pitch than the rest of the pack. This might be why dogs often howl off-key when they hear music. Based on research conducted by psychologists, dogs prefer classical music to pop and heavy metal. They might find the instrumental music soothing and the heavier music more agitating. Additionally, personal preference among individual dogs might play a part.