Flushing can be risky when the history of the transmission is unknown.
A transmission flush is a maintenance process where all of the oil in a transmission is removed, new oil (and sometimes cleaning solutions) is run through it using a special machine to push out grime and sludge and then it is filled up with new oil.
If the grime and sludge is too great, the machine can dislodge enough grime and sludge to clog up the transmission.
For transmissions with a unknown history I recommend frequent Drain and Fills until one is confident the transmission does not contain excessive grime and sludge. You watch the fluid between Drain and Fills, if the fluid darkens quickly, that is a sign of excessive grime and sludge.
Flushing is a Preventive Maintenance process. Using Flushing as a Repair Process can save one a ton of money but it does come with risk as outlined above.
In Short: Flushing keeps a transmission from building up grime and sludge, but if grime and sludge are allowed to build up to excessive levels, flushing can literally choke a transmission to death.