Yes, you can prepare for GATE while doing an M.Tech from IET Lucknow. You will have to self study and make a schedule that works for you. There are GATE coaching centers near IET. If you opt for hostel accommodation, you can easily manage your coursework and preparation for GATE.
You can get time to prepare for the GATE while pursuing your studies from IET Lucknow. You must have self-control, design your schedule as per the needs, and maintain your study schedule.
One of my friends appeared in the GATE 2015 and got admissions to NIT Trichy. He again appeared for GATE 2016 with minimal efforts and did not show any extraordinary results. He again appeared in GATE 2017, it was the same year he was to complete his M.Tech degree, he got AIR 5, and then he chose to get placed in ONGC through his GATE score.