Yes, you can.
There are no restrictions on going out of the campus unless imposed by the institute in extreme situations (health or safety reasons - during Covid, for example). However, you are advised to carry your ID cards all the time so that it would be easy to identify yourself as an IITM student when asked at the gates while returning.