Is the word "dear" used as a word to show affection or for official use in India?
Solution 1:
Indian here. So I've been called 'dear' in some situations where it felt weird. And in all of them, the speaker was mostly trying to communicate familiarity and affection. See, when we speak in Hindi, we generally add a word like 'bhai' (brother) or 'sahab' (sir). So the 'dear' is probably an attempt to showcase their affection for you. They just don't know that such usage is uncommon and that there are other phrases to convey the same emotion.
A person who my dad was consulting texted me asking for some info. When I gave it to him, he said "Thank you, dear." He would never call me dear to my face or on phone, so I think this meant, "Hey, thanks a lot, man. Bye." in textspeak.
Having clarified that, PLEASE NEVER EVER CALL A GIRL OR WOMAN DEAR WHEN YOU DON'T KNOW THEM VERY WELL. The traditional people would balk at your forwardness and the open minded people would react the way you'd expect an American (assuming a random country) to react: "Is he alright? He's acting weird." And don't call males 'dear' either. I can't predict their reaction but you'd be better off avoiding it altogether.
Be yourself. If some dude calls you 'dear', please inform them that the word isn't normally used like that. Tell them to call you bro or pal or something else you're comfortable with. Not only will it help them out, it will also reduce the number of unintentionally creepy Indians on the planet, for which I'd like to thank you in advance.
Solution 2:
Well-educated Indians use the words dear and dearest exactly in the same way as people in the UK or the USA do.
However, it is not uncommon to see some Indians prefix the word dear to an instruction or a piece of advice. Also, some Indians say 'Hello dear', when they could easily say just hello or hello xyz.
As far as I know, unlike some other common Indianisms, this does not appear to have an equivalent in Hindi, or in Bengali. I cannot vouch for other languages. It is definitely not common to hear something like "Priya, is kaam ko karna hai" in Hindi.
As an Indian, I find the usage quite patronizing, (though it may not have been intended as such), and either ignore it, or tell the person so, based the situation, or my relationship with them.
It is, however, more common for Indians use the word sir or madam, instead of dear, in the situations described by OP, for example, "Sir, you need to do xyz", or "Hello, sir!", or while being defensive. I cannot make out whether we Indians are polite or apologetic.