I don't know if you could train a dog to growl, specifically, but you can certainly teach him to bark/alert on command.
When I was young, I spent a lot of time walking/biking alone with my dog. If ever I saw a sketchy looking character out in the middle of nowhere, I would call my dog close to me, grab her collar, and say "be nice" in a somewhat stern voice.
My dog was not trained to bark, or growl, much less bite anyone--she was a pretty benign creature with people, but the sketchy people didn't know that! They just saw a young woman with a big GSDx that apparently had to be held back in the presence of strangers, lest she go off like a loose cannon.
It must have worked, because I was never threatened, accosted or hurt by anyone when she was with me.