You can't keep something like a cat, dog or anything else in such a small space in your room in halls of residence. You're not going to be in a lot of the time to feed it, go for walks, play with it, clean it out, etc. It's cruel to keep pets in such a small space.
The vast majority of people you'll be living with won't like it at all. For all you know, some of them could be allergic to whatever pet you want to bring in. They'll have to deal with noise and mess too. I guarantee you'll be relying on them to take your pet for walks or to feed it when you're busy in lectures, doing work in your room or going out doing other things, which isn't fair.
I'd refuse to live with anyone with a pet in halls; I don't want a pet making noise and scratching at doors when I'm trying to work. I don't want to be given responsbility for the welfare of someone else's pet. The pet won't even be safe; how do you know what people will do to it in halls when they're drunk? How do you know other people won't feed it things it will have a bad reaction to and hurt it? How do you know the pet won't attack someone out of fear?
You'll need to make financial allowances for food, sanitation, vet bills etc. On a student budget that's not going to be possible. What if on a drunken night in the kitchen someone accidentally hurts the pet and you get a £300+ vet bill you can't possibly afford? Every week you'll be buying food, sanitary products, possible toys and treats and other things which will eat into your money, leaving you unable to support or enjoy yourself.
Even if you want to take a hamster or something small, don't. You'll still have to pay for its food, health and sanitation. Get a pet when you graduate and have a stable job, so you can look after it properly.