If you are referring to dry floral foam that does not absorb water, yes, but you should either keep a cup of water inside the container or wrap the foam with wet paper towel for a good humidity. If you are referring to styro foam, then yes if you can carve it cleanly, and if the pupa can grab onto it to flip himself over. Anything works okay as long as the pupa can grab a sidewall to flip himself over.