There are rules for determining "Destroyed" (most in-game 'Mech kills) as opposed to "Truly Destroyed."
Anything that was just "Destroyed" can be repaired.
Anything that was "Truly Destroyed" (requiring the destruction of all Centre Torso internal structure) can only be scrapped for parts. If there's anything left at all.
As a result, most damage can be repaired. So it's mostly a cost/benefit analysis. Theoretically, a 20-tonner with every item on board destroyed, all armour and internal structure marked off but for one point remaining in the centre torso can be rebuilt if you really want to spend the time, effort, and materials to do so.
In practice, there's not much point to doing that and the wreck should probably just be rendered down for parts. The other thing to be factored in is whether it's a design that brings prestige, like an Orion IIC or a DishonourMobile like the Bowman. The former is pretty much garaunteed a rebuild, while the latter is less likely to be returned to service. I suspect most Clans would be more inclined to rebuild things that use the Clan technology base than their SLDF relics due to compatibility issues, too.
Mostly a case-by-case basis, unfortunately. I guess if a rule of thumb is really needed, maybe they rebuild as long as at least 10% of the 'Mech's centre torso internal structure remains or something?