To answer the OP's question, a broken string can sometimes damage the piano, but rarely does. The wire can whip by the cabinet, the soundboard or painted metal plate and put a small scratch in it. Superficial/cosmetic damage at most, and like I mentioned, it only happens rarely.
The piano's design scaling, does differ between pianos but the manufacturers strive to keep the tensions within a zone of breaking strength % and relative to the available guages of wire they have. Within these paramaters they try to keep string tensions as uniform as possible to the extents of the keyboard so that the bridge/sound board are not unevenly stressed...this keeps the instrument structurally sound over the years and also keeps the piano better in tune with itself as the seasons/enviroment change during the year. Tier I pianos are generally better scaled than cheaper instruments and will not have the types of issues related to poor scale design and implimentation.
The strings can break for numerous reasons. Hard playing, rust/pitting/excessive age/ Large adjustments in pitch, human error in tuning. Good experienced tuners very very rarely break strings due to being on the wrong pin;for new or lesser experienced tuners, it does happen. Occasionally I will get a really loose tuning ping and when I crank on the tuning hammer it will jump quite sharp, broke a string like that a few years back, was honest and replaced it at my cost. Measures can be taken to reduce the likelyhood of breakage on pitch raises and old pianos. The strings can get lubricated with CLP at their bearing points to help break rust free. The tuner should ease the string flat first to break the rust bond, before raising to target pitch, large pitch raises can and often should be done in steps, rather than all at once. String splices do work nicely if its broken on the non speaking length...it should really only be done on the wound strings...no reason for a technician to not have unwound string in the proper guage available. Bass/tenor strings which break and are a pair/unison should ideally be changed out as a pair, its rare to get a nice match on inharmonicity with and old and new string on a unison....even rarer if using a universal spare bass string.
Sometimes poorer quality instruments will have a poor scaling choice for a particular string and these are more susceptable to breakage and may even have issues with proper tone. A good technician or string maker (for wound strings) will substitute an upgraded string which may improve the sound and longevity of the string...there are charts and compurer programs which are used to determine this.
When a new string is put on, there will be a period of time where it adjusts/conforms itelf to its newly formed seating position on all its bearing points and hitch pin/tuning pin. It will tend to go out of tune rather quickly compared to the other strings. This is incorrectly called "string stretch"....the string will only stretch to deformity if it exceeds its Youngs Modulus of Elasticity. They are not pulled to that extent of tension. Some techs will bend the hitch pin turn, lay out the string line, seat them on the bridge and form tight coils on the tuning pin better than others...the string will stay in better tune because of this for the first year or so until they fully stabilize. If the string replacement is poorly done, the string can, and will drop pitch more quickly because it will eventually fit and conform itself to its proper position...but this takes time. You get what you pay for with a tech, rarely pays to go cheap on them.