It's not a fine line at all. You approached and spoke to that woman because you felt entitled to. That woman didn't ask you to, didn't approach you, yet you thought it was OK to speak to her. The fact she didn't mind is not testament that it is OK to do this sometimes, it's just that you were fortunate. Or maybe there was body language to suggest your approach would be welcome which is a very different scenario from the ones we are speaking of. Of course, she may have recognised you from walking to work. Again different scenario.
But you still didn't have to go and speak to her. Yet you did. Because you wanted to. Men approaching strange women in the street is all about what they want.
And generally strangers do not say hello to each other when walking past each other on a street. Unless you are like the only people around or out on a country walk or something similar. Context, as before, being everything.