Yes, Allahabad University is a safe place for students who have taken admissions for the sole purpose of studying.
Although there are politics, groupings, and leadership roles that influence the environment, it would not affect you or harm you in any way if you are not involved in it. Try to stay away from politics and student elections and you would be far from being unsafe or in trouble. Make sure to utilize your resources to the best of your advantage and keep yourself away from the disputes that take place there.
Every college has certain rules and so does Allahabad University. Follow these rules while you are in college. Also, remember that the kind of company you keep influences the environment around you. So, choose your peers wisely.