I take issue with the folks indicating in posts that there's something odd or wrong about men teaching children. At all. That's assuming that any man who teaches any form of class to any young girl is possibly a pedophile. What about male coaches of sports teams? I don't see many women coaching little-kid soccer around here, or t-ball, etc. So should we assume all those coaches are pedophiles? Yeah, it happens. So do cases of women teachers preying on boys in their classes. Let's get past stereotyping men; we hate it when they stereotype us.
Your daughter does need to deal with this soon and you are right to want to help her. When she starts school she will encounter male teachers (gasp! Yes, folks, there are male teachers even in kindergarten classes -- I've seen it!), male coaches in gym, male principals and guidance counselors and even men who help out with her scout troop for an event or men who go on the class field trip as chaperones.
If you have already looked at and dismissed the idea that she somehow fears men because she's been abused -- that's the first thing to rule out and I'm figuring you have -- then ask yourself: Is she shy around some women too? Is she shy around other kids at all or is this related only to adults? Does she have jumpy or fearful reactions to loud noises (men's deep voices could be scary to a very young kid) and could that be in play here? Did she maybe once have a bad experience with an uncle or cousin grabbing her for a hug suddenly and startling her badly, though innocently? Just some things to think about. She is so young that you likely will not get much of an understandable response if you talk to her -- but you still should try; don't lead her but do find a time when she is calm and happy and see if you can talk to her about why she is afraid.
It might help if your whole family took an outing to someplace she really, really wants to go (amusement park, stage show or play, something special) and a close male friend of the family\, someone she's at least seen before, came along with instructions to be very low-key around her--just be there mostly in the background (to her). That might help her start to realize that she can have fun when there is a "strange" man around, and it also sends her the signal, from you and her dad, that this man is a safe person to have around her. If she gets through that experience OK and has focused on the fun event rather than on that strange man who was there, you can try other such outings, or have a male friend over when there is a cookout or other distracting event at home. She needs to see that when you and dad say these people are OK to be around, she doesn't have to worry.
She may well outgrow this; I've known other kids who outgrew fear of strangers (men and/or women) by about five or six. But if this seems very strongly tied just to men, or if her reactions worsen, I would next talk to your pediatrician for ideas.