I concur with those who recommend approaching neighbors who are already out in the yard. I have this sort of conversation with neighbors all the time - I actually pulled over yesterday and asked my neighbor where he'd gotten his load of compost delivered from. But I would not have knocked on the door to do it.
I did once knock on a neighbor's door to ask what type of pear tree he had in his yard. As in, "Hi, I'm your neighbor from around the corner, and I was wondering what variety of pear your beautiful tree is. Thank you, have a nice day." But of course, if he had not answered or did not want to talk, I would have left immediately. However, being a proud gardener he wanted to tell me all about the history of the tree, and we had a lovely talk. If it had been anything where I was asking him to give me something, or do something for me (like look up a phone number, etc), I probably would not have knocked but just waited till I saw him out.
I don't think knocking is, per se, rude - that's what doors are for. I have cultivated a habit of walking in the neighborhood, so I can combine my exercise with getting to know my neighbors. I think a lot of this may depend on the personality/culture of your neighborhood. Ours has a lot of walkers/dog walkers/kids playing in the yard/gardeners/DIY types, so people are always out and about and talking to each other. I have also lived in neighborhoods where you never see a human resident, only cars, and all the yard work is done by a service. I would not ask or approach anyone in a neighborhood like that. (That's part of why we moved!)