I have seen etching from open cell foam on steel guns. I have also a bunch of Speer Gold Dot 9mm ammo that was stored in the little yellow boxes that have the foam pad in the bottom.
The foam has disintegrated and it must be cleaned off EACH round before you can shoot it. My BIL did not use the ammo and left it in these little boxes for over 20 years. It shoots ok but is a pain to clean.
I don't store any of my guns on/in foam.