I've had a few really uncomfortable experiences with this. My answer for years had been "yes, of course!", but then two examples I'd held up turned out to not be good examples at all. I'm not sure if I can tell or not, and I've been a bit wary of striking up close male friendships since.
Generally, either two people who are happily in relationships with others, or two people NOT in relationships so if something were to happen, it is free to happen, seems to work best.
Oh, one more thing, though... sexual orientation. Have maintained several perfectly wonderful non-icky (dynamics wise) friendships with gay guys. I like men, and it's so nice to absolutely not worry about it!