Dangers of spray foam in body panels?

I wouldn't use spray foam on anything good but it is your car.I have used it when I was younger and needed a way to get a old truck through mvi .If all you want is to keep crap out of there I would go get some foam pipe insulation.Home depot has different sizes I'd think the size to go over a 3/4"to 1" pipe would work well. You can tuck it in as it's grey in color it wouldn't stand out and it would keep crap out but be removable so as you can still rust coat or clean if need be.