What happens inside the tire
A tire holds its shape with air. Take the air away and the sidewall folds under the weight of the car and gets pinched between the road and the wheel rim. Every rotation grinds the inside of it. The cords break, the rubber heats up and the inner liner can tear, even when the outside still looks all right.
That's why a flat tire that has been driven on usually can't be repaired, even if the original puncture was a tiny hole in the tread. A technician has to look at the inside, and what they often find is damage that wasn't there before.
What happens to the wheel
Once the tire is crushed, the metal rim starts taking the hits. A wheel can bend or crack, especially on a bump or a pothole, and an alloy wheel is less forgiving than a steel one. A bent wheel can cause a vibration and may not hold air at the bead. The tire-pressure sensor inside the wheel can be damaged as well.
A shredding tire can also whip against the fender liner, wiring and brake lines. On some cars the flailing rubber is the more expensive problem.
How far is too far
There's no distance that's safe to promise. A few hundred yards at a walking pace to get out of a lane is a different matter from a mile at 40 mph. If the tire is only low, with air still in it, a slow drive to a nearby pump or shop can be reasonable. If it's flat to the rim, treat every yard as damage.
Speed makes it worse. The heat that builds up inside the tire climbs with speed, and a flat tire driven at highway speed can come apart quickly. Run-flat tires are built for a limited distance at reduced speed, so the rule is different for them. Your manual gives the figures.
If you've already driven on it
Don't assume the tire is repairable. Let the tire be inspected from the inside before anyone plugs or patches it, and have the wheel checked if the car has started to shake. TRA doesn't repair wheels. If the wheel is bent, that's a shop job.
Seen next to each other, the numbers are clear. A tire repair for a tread puncture is $54–$60, and a replacement tire is from $129, each plus the $19 dispatch fee charged once per job. The gap between those two is roughly what a few extra blocks on the flat can cost you. If you have a spare, the quickest route back on the road is a spare tire change, which is from $75.
Common questions
It's a bad idea even when the shop is close. The tire will likely be ruined and the wheel can be damaged. A mobile repair or a spare change avoids both.
Not reliably from the outside. Signs include a sidewall that looks creased or scuffed, a bulge, a vibration when you drive, and a rim with scrapes. The inside is what matters, and only a technician can inspect that.
Move it as little as possible, slowly, with the hazard lights on, and only to a place that's safer. Safety comes before the tire.

