Cornering a rat in a location where it cannot escape is not a good idea, because in this type of situation a rat is likely to become aggressive and possibly dangerous.
Generally speaking, rats will avoid confrontation and will attempt to escape and hide in the presence of a threat or predator.
But, if you corner rat it will most likely become aggressive in an attempt to defend itself, which often leads to rat bites in animals and people.
Many pet owners find this out when their dog or cat chases a rat into the corner of a room, forcing the rat to become aggressive and bite the animal.
It is best to use a more passive method of rat control, such as baiting a rat trap, rather than using more aggressive means.