This is often seen in puppy mill rescue dogs, dogs who have had little or no human contact at all. When you take this animal and put him in a social setting (crowd, park, veterinarian's office), he may feel trapped and cornered, resulting in fear aggression. A dog who is cornered has no "flight or fight" option. "Fight" is all that is left.
By beginning the socialization process early, you are training your dog to handle himself in busy situations. A well-socialized dog is not fearful of crowds, and plays well with other dogs. Start by taking your puppy out to different places. It is best to do this after he has been fully immunized against Parvo and Distemper. By exposing him early to different sights, sounds and people, you teach him young to accept these as normal, and you will have a happy, friendly dog who handles others well.
If your dog is already an anxious dog, you need to take steps now to get him to overcome his fear. Start small. Begin by bringing one person over. Let your dog initiate contact. Be sure that your dog has a safe retreat he can go to if he feels overwhelmed. Desensitizing a fearful dog is hard work and a long, drawn out process, but well worth it. You will need to judge your own dog on how much he can handle at once. Some are fine indoors, or in their own territory, but panic at leaving home. Just remember to always start small, reward for good behavior, and try not to comfort him, as this will enforce the fearful behavior, rather than help him overcome it.
Through steady exposure, you should notice that your dog is relaxing more, as things become more familiar. Make every outing fun. If you take him down a busy street, and he is scared, take him to a park to play, or a walk down a quiet street so that he is not fearing the outings, just the situation.
While he may never learn to like being out in busy areas, he will tolerate it, if only to get to the "good" part of the outing at the park after.
Introduction to Canine Mental Health
Do Dogs Get Depression?
When Anxiety Attacks
Biting the Hands That Feed You
Obsessive Compulsive Behaviors