A dog should never be allowed to bite, even in fun. they need to learn manners, just like kids do. Almost every little kids tries to bite his/her family members when they are a toddler; and has to learn that this is totally unacceptable behavior. Dogs are no different, and they have to be disiplined when they act aggressively towards other people.
I suggest putting the dog on a leash so you can control them when someone comes, and then make the dog sit quietly and not bark or lunge at the visitors. If your dog is not leash-trained, then this should be done first, so that the dog knows and obeys basic obedience commands, such as "sit" or "down".
When the company arrives, keep the dog beside you, and sitting or lying down, and scold him if he barks or growls.
Soon, he should learn what is expected behavior around other people. If he does not respond to voice commands, then a training aid, such as an ultra-sonic trainer might help. I got one from Amazon and it stopped my dog from barking right away, and it is harmless to the dog.