Foam is made from a mixture of protein and water, I believe. It is a bit smelly, like spoilt meat, but not especially corrosive as far as I know.
The corrosive stuff is the dry powder extinguishant. That makes metal turn into a furry mess, plus it's abrasive. Spray that into an engine and it would need an overhaul for sure.