Three kinds of track work
A dent at bumper height in a vertical track is straightened with the door secured, as long as the steel has not kinked. A track that has spread or gone out of plumb, so the gap between it and the door is wrong, is realigned at its brackets. A rusted or crushed length is cut out and a new section bolted in to match.
Replacing a whole track is rare on a door that is otherwise sound. It comes up when the track has rusted along its length, or when a door is changed for one that needs a different track radius or headroom.