Depends on the type of rifle.
Some rifles are made in such as way that you can put a straight edge on the top of the sight and compare with a flat on the top or side of a receiver, rear sight base or other feature on the rifle.
Other rifles are simply "eyeballed" to spot canting.
Repair, again, depends on the rifle.
Usually repair requires driving out any pins, moving the sight base straight, then re-drilling the holes and inserting new pins.
The trick is to remember that what you're really doing is cutting new grooves in the barrel for the pins to fit into, not drilling holes.
It's too easy to enlarge the holes in the base and wind up with a situation where the holes are bigger then the grooves and the base is easily bumped out of alignment.
Often a real professional will CUT new grooves using a milling machine bit to re-cut the grooves straight.
While it's not unusual for a damaged sight base or a base that was cheaply made to have ears that aren't even, it's not a big issue unless it's so bad it's distracting.
Sometimes the ear can be heated up and bent back into shape, but sometimes the ear will simply snap off, ruining the base.