You don't have to worry about dowry burning (the kitchen fires) but I would definitely be cautious walking around alone, just as you would if you were in a large city in the U.S. As a caucasian woman, you might be considered more approachable compared to Indian women who wouldn't give them the time of day. There is a problem with eve teasing, which is basically groping or catcalls in public places, like crowded trains or sidewalks. This is the sort of thing that happens in a repressed society. ugh.. though I must say that dating is becoming more the norm in big cities. You may also notice that men walk around holding hands. They aren't all gay It's socially acceptable for same sex friends to hold hands (men or women) but not for hetero. couples. Again, things are changing rapidly, esp. in places like Bangalore.
In the first situation, they were probably wanting to brag to their friends or post it on FB, but you were right to walk away. When I was in college I traveled to Europe and some men asked to have their picture taken with me! I thought it was weird, but I think they just wanted to brag to their friends and I was "Exotic", which is hilarious because I was such a goody two shoes and never dated anyone or anything. I let them do it because I thought it was funny, though of course now I know better.
As for the second scenario, he was probably just asking you to open the door to talk, but you shouldn't do anything that creeps you out so you did the right thing. Better to be safe than sorry.
"Friendship is born at that moment when one person says to another, "What? You, too? I thought I was the only one." C.S. Lewis