I’m not sure if animals get songs stuck in their heads as humans do. I know they can recognise certain songs though. Depending on the conditioning from the event and song, it can be positive or negative feelings of recognition.
Our previous dog could recognise certain genres of music (before he became hard of hearing in his old age). How he acquired this talent was through years of hearing different genres being played with my different moods/activities. When certain songs were played, he would know exactly what to expect from me. He even knew some Michael Jackson songs and John Williams pieces (from Schindler’s List). After years of hearing the songs and associating the music, often, with my dancing or drawing…he’d come to expect that certain behaviour at home. I’m not saying he could understand the song or the music..but he made his own associations with those specific sets of sounds and my behaviour.
He had also had negative reactions to songs with lots of screaming and/or swearing. He would tuck away and hide (because of past experiences with those).
Many people think animals are constantly living in the present… not exactly true. Dogs, for instance, are actually living in the past every day. They are constantly expecting certain outcomes for associations they have made through past experiences. Classical/Operant/Pavlovian Conditioning are all very much in practice with hon-humans, just as often as in humans. It is very basic. However, the associations can be quite complex.