I can´t answer you specifically for India, so there my be a few things special to consider, that I did not cover here.
Basic work ethics to consider:
Are you on or off the clock? During your paid time you should not engage in any behavior that is not beneficial to your employer. On your time off, you are a private person and it is your absolute right to talk opportunities with other private persons.
Consider that, if a superior hears you are actively looking for new opportunities, he may consider firing you. Reasons are that he may not trust you now and that he want control the timing. He may also stop investing in you, so no more training and interesting projects. So be careful where and what info you spread.
Networking: On the other Hand, the best jobs ind the best companies are often never really on the market - and if they are, not for long. If you want to be offered such opportunities, you should build your network. If you stay in touch with former colleagues and give them tips and info's that helps them further their career, chances are they will return the favor.
At last, one word about talking salaries. You as an employee are at a serious disadvantage, as you have much less info on the salaries typically paid than you employer does. This is a big disadvantage in negotiations. It is your rightful interest to get the best possible price for your work, so talking and comparing salaries/offers with your colleagues helps all of you to get paid reasonably.
That is why, in Germany, the court ruled that an employer cannot forbid their employees to talk about their salaries and any contract stating otherwise is void.