It's rare to have to bend a modern barrel, but some do get bent in shipping, and some are not bored straight to start with.
I had one such crookedly bored barrel on a rifle I had traded for, in that the hole was off to the right side at the breech, and off to the left side at the muzzle. Of course, this one needed the front sight barely hanging onto the dovetail as it was pushed way to the left and the rear sight was barely hanging in, moved to the right. The barrel should never have left the manufacturer, and/or should have been breeched and mounted with the offboring up and down, not left or right. Bending might have worked, but perhaps not for all ranges due to the amount it was 'out'.
It's rare but can happen.
Les Bauska had a barrel straightening machine in front of one high window in his shop, back in 1975, when I visited him in Kalispel. He showed me how to straighten barrels on his machine and I spend about 2 hours doing just that - straightening a lot of barrels. It was fun - for a while. Most needed only a little tweeking and some none at all, while others had 'bent' while in his bed-planer-type milling machine having the flats gouged on. They were already rifled.
The conscentric rings are what one looks for and non-round rings show the bending area. The barrel sat in two anvils (V blocks) angled upward to the window. Another V block above & centred between the two lower blocks, to push down was controlled by a wheel with pegs looking like belaying pins sticking out radially around the wheel. You merely pulled a pin towards you which turned the overhead shaft on a fine pitch screw and the the overhead anvil pushed down onto the barrel, bending it. Turning the peg back lifted the anvil and looking through, you could see if the barrel was straightened at that point, or needed more 'work'. It seemed easy to not go far enough, but the barrels also sometimes seemed to not want to bend at all and needed a LOT of work - many attempts to get the bend to 'take'. Too - I was new to this, unskilled and was very careful not to destroy any barrels.
Bending finished barrels was a good experience - and not easy, as James noted.