I agree with Kirsten. Tell the teacher and ask her to do a general talk, or several, about using kind words and not doing the "you're not my friend unless" routine. Kids need to hear this; in preschool this is exactly the kind of social learning they need to be getting because by kindergarten, teachers are too overloaded to deal with it much. She should NOT specifically single out this boy and your son, and should not say to the kids that "Billy's mom told me about this...." but a general talk about friendship (repeated if needed) from the teacher -- rather than parents -- can nip this in the bud at school. Also, I'd ask the teacher what consequences she plans to use when she overhears this kind of talk.
At home or on playdates, the boy likely will revert to this, at least until he outgrows it. If you generally like the kid's behavior other than this, then only do playdates with you and the mom (not the nanny, with whom the boy seems to go off the rails again). Or cool it on playdates with him for a while at least; find your son other play dates with other kids who don't do this. But it is a common behavior, unfortunately. If the boy just can't seem to shake it or be distracted from it during a play date, I'd be too busy for play dates with him for quite a while. If your son asks why he hasn't had a play date with this boy, just tell him that you've been too busy and he's been seeing other friends.