Dogs, smart as they are, seldom learn to avoid porcupines, skunks, or racoons. They will get into them every time they are close.
Porcupines smell like bacon and if you shoot one, or find a road kill, you can light it on fire like it has gas on it.
I had a English Setter that got skunked and the very next day the dummy got hit again and even brought a live baby skunk into the house thru the dog door!
My brothers Pointer has had to go to thru the porcupine thing every year in So. Dakota, and this year, twice in the same week!
We had Blue Heelers on the ranch and they are some of the smartest things on the planet. Skunks, racoons, and ranch cats kept them smelly or bloody all the time.