In a diesel engine its fine... in fact, you can burn straight ATF, but it isn't good for it at all. There was an article in Diesel Power magazine recently about a guy who burns about 70-80% ATF in his powerstroke.
In a gas engine, it does nothing more than adding engine oil. The old wive's tale about ATF being so good at cleaning is completely false. People crack open transmissions and see how clean they are compared to 3000 miles on engine oil and assume its the oil. The truth is, transmissions aren't responsible for dealing with the blowby like engines are, but the ATF oil itself isn't any better at cleaning things in a fuel system than engine oil, or vegetable oil, or WD40... or anything for that matter.
ATF isn't a wonderful cleaning agent. People assume it is because transmissions stay clean, but its not because of the oil, its because of the transmission.