Except in rare instances, it really isn't done anymore, particularly in urban and suburban areas. These vendors often case out your home while trying to sell you excess fruit they got a bargain on or super stereo speakers that are being closed out or gold club memberships. While giving you the pitch at your front door, they may be taking a quick look around to see if you have a security system, an easy front door to jimmy open, looking to see if you have a dog, etc. Tell them you are not interested and shut the door. You are under no obligation to listen to their pitch or to be nice to them.
Criminals prefer easy targets.
The more difficult a target you present, the less likely you are to become a victim. If you look like an easy target, you probably are an easy target. Carry yourself with confidence. Keep your head up and shoulders back. Don't look at the pavement when you walk.