When I was in Kathmandu I met up with a friend of a friend for breakfast near Durbar Square. She offered to buy me some sweets and tea from her favorite vendor. It was Mother's Day (a few weeks earlier than Mother's Day here in the States), and there were crowds of people buying sweets in bulk for celebratory meals. The sweets, which came in dozens of varieties, were piled up high on tables in front of the ancient store fronts. And the tables were swarming with flies, attracted by the sugar. Did I eat the sweets? Of course I did, and they were delicious.
I've eaten street food in cities all over the world. And yes, there's plenty of vegetarian street food out there. Have I ever gotten sick from eating it? Not even once. I've gotten sick from food in a few countries, but never from the street food.
I should mention that there are some common sense guidelines to avoid getting sick. most people know that in some countries you shouldn't drink the water; the risk of encountering some water-borne pathogen are just too high. Remember that this extends to things that may have been washed in water, including some fruits and vegetables, and ice. If you find a fruit or veggie that has a peel or removable skin, you should be good to go. One of the most delicious things I ate in Thailand was this green mango, sliced and served with a mix of chili-sugar-salt. And I bought it from a vendor next to a gas station outside of Bangkok.
The other guideline to keep in mind is to be aware of the street food culture of the country you're visiting. In most of Southeast Asia fruit vendors can be found all over the place, selling the best and freshest fruit you'll ever eat. In Taiwan you'll find the celebrated night markets, where (among other things) I found a vendor grilling king oyster mushrooms like sausages, then brushing them with a sweet and savory sauce, slicing them, and topping them with sesame powder. It was amazing. At the night markets thousands of people eat street food every night. To paraphrase Anthony Bourdain, no one is going to stay in business if they're giving people food poisoning. (See my experience with the sweets in Kathmandu above.) In Egypt there's a huge street food culture as well -- my experience with koshary, the popular national dish, was way more delicious when I had it from a street vendor than when I got it in a restaurant.
In short: when you're traveling, eat the street food. It's often the most delicious food you'll find on your trip. Use some common sense, but there's no reason to fear it.