Selective aggression?

My dog is only aggressive towards certain people. He doesn't mind the vet or some random strangers at the park or at the stores. Other times he goes ballistic . He barks and growls like something is really wrong. He almost bit my aunts ex husband (not that anyone could blame him).