A lot can depend on the specific context with any social interaction...
If you're greeting a professor coming into a class, remember that he or she probably has stuff to do: getting the projector fired up, slides loaded up, notes ready, etc. and so this may not be the best moment to make small talk. That doesn't mean that you shouldn't ever try - just try to read the situation and be respectful of what the other person needs to get done.
As brought up above, there can be cultural contexts at play as well. Some professors (even those who grew up in various parts of North America) will have come through more hierarchical systems than you might be used to - professors teach, students listen. That's not to say this is how it should be or that students should not ask questions. They should. But some professors will react in different ways to this. In addition, some professors may be adverse to socializing or being perceived as socializing with students - as it may look like they are showing some kind of favouritism.
With respect to bombarding professors with questions here are a few tips.
- Have you thought the question through yourself? Is the answer likely to be found in the lecture notes, textbook or through reading online?
- Have you thought about what you're asking? Are you trying to tackle a specific concept? Or could you be perceived as someone just trying to get the homework answers.
- Are you dominating the professor's time during office hours? Are other students who may not be as assertive getting opportunities to ask questions? Are you listening to the answers when they ask?
- Have you asked a similar question before?
- This may come as a surprise, but professors don't always know the answers either - at least not right away. Sometimes they will get frustrated because they end up working through a problem that it seems the student could just as easily get through.