The builders kind of foam is no good but the foam used for cushions and mattresses is fine. The issue is getting the raw material that can be poured into a duck and to get the correct fill and density.
I looked at it for filling damaged fenders but foam manufacturers don't like to sell the raw material.