Most of the top colleges like IITs and NITs allow all branches to sit for placements. But it’s a fact that Mechanical Engineering has stooped to a new low since 2020. The placements have become miserable now. Some tips you can follow to sit for placements are:
Maintain a good CGPA ( 8.5+)
Become proficient in coding
Maintain a good rank in websites like CodeChef, Hackerrank, Hackerearth, etc
A good resume is always the top priority for any candidate
But it mainly depends on the placement cell whether they want to allow you for a CS job or not. In most cases they do but if not you can always go for off-campus placement with your NIT tag.