It depends on where the damage is, and how severe. The aircraft is inspected, and if the damage doesn't exceed certain criteria, it probably can be "maintenance ferried" to a site where the airline has repair facilities. No passengers, or even flight attendants, are allowed on a MX
ferry, just the flightcrew. One of the airline's maintenance controllers and a flight dispatcher must authorize the flight, and the paperwork is then sent to the station for the captain.
One of the common flight restrictions for an aircraft with fuselage damage is that the aircraft must remain unpressurized. That usually limits the aircraft to a max altitude of 10,000 feet, and we crank that into the fuel planning for the flight to the repair facility. Other restrictions might involve avoidance of icing conditions, limiting operations to day-only, or cloud-free conditions.
Some types of damage require fixing the aircraft wherever it is. For example, if someone drives a tug into an engine cowling, the cowling will most likely need to be changed on-site, which means a new cowling will get trucked in, and then replaced. If the airline doesn't have its own mechanics at that airport, it'll fly some in to accomplish the repair.
I'll let the maintenance types chime in re: how much damage is too much for a MX
ferry, but I've covered the general items...
ALL views, opinions expressed are mine ONLY and are NOT representative of those shared by Southwest Airlines Co.