My DD1 would play with anybody but I don't necessarily allow it. Just today I had to pull her away from some kids at the lake because they wanted to sneak up on people and throw rocks at them. Nope, not gonna happen. I also don't allow her to play with certain neighbors because I know there is excessive drinking and/or smoking going on often at their homes so she can't go over there even though she really really likes them and wants too. Also, if neighbor kids come over they have to follow our house rules, their parents have to know that they are at my home, and I am NOT feeding them meals. An occasional snack maybe but that is it.
I wouldnt let my kids play somewhere where i felt they would be unsafe, i would invite the child over to our place instead, but i wouldnt discourage the friendship (judgemental what...how do you know about excessive drinking at her place anyway? )
Kids throwing rocks? Bad behavior. Different story. I dont say-'you cant play with those kids', i say 'you cant throw rocks at other people.'