Luckily foam-resin compatibility is not too difficult to understand. This one will be quick.
Will Fiberglass Resin Melt Foam?
Using the wrong type of resin on certain types of surfboard foam will melt it.
PU, polyurethane foam, will be okay with either polyester resin or Epoxy resin.
When doing repairs, it’s generally a good practice to try to match whatever resin the board was built with. However, if you’re unsure, epoxy is your safest bet.
If you are absolutely, 100%, completely unsure of what kind of foam you have and you have some polyester resin that you really want to use for whatever reason, your best bet would be to test it on a small piece of scrap foam and see what happens.