I bought a dog. What is it good for?
Solution 1:
The Junkyard dog counts as 5 points of defense towards whichever settlement you send him to. Also they create happiness in your settlements.
Solution 2:
Sorry if this is a bit late but just thought I'd share my experience.
The Junkyard dog does wear bandanas - you just can't choose or "equip" them. His bandana changes regularly so give it time and you will see him wear the skull one!
As others stated, he adds +5 to defense and if your settlement is attacked he will be the first to step into battle! I have seen some say he is invincible but he died very convincingly when I shot him...long story but he became hostile when I tried to clothe him via "pickpocket". All my settlers became hostile even though he is "my dog" so I think he does count as a settler and takes up a slot.
I do not believe he can ever be a companion as there is no way to "command" him.