Hey man! Good question!
I believe you are certainly allowed to use spray foam inside the PVC. There is certainly no rule against it. However, everyone is going to shout at you "DON'T USE PVC!" and I 98% agree with them.
PVC Pros:
-You can buy it locally
-It's cheap!
PVC Cons:
-Will definitely break quickly (and once your core breaks, nothing can be salvaged from the build)
Everyone will tell you to use something else, and they are probably right, unless: (1) You are just practicing and you literally don't care at all if your sword doesn't last and (2) you have enough money that the loss of materials is meaningless.
But if (2) is true, then you should just buy some cores online. You can use 1/2" solid round fiberglass from Kencove (
http://www.kencove.com/fence/Fiberglass+Posts_detail_F12-4SG.php - Note: I recommend using metal in the handles both to make 24oz. and to make it stiffer because 1/2" round will flex out eventually) and I also sell some interesting cores (PowerBeam+, PowerTube.75) that work great for minreds through my online store, Foametheus (
http://www.foametheus.com), that you won't need to reinforce and shouldn't need much weighting either.
All of these options are virtually indestructible. This means that when your foam dies (and die it shall) you can strip it off and build a new blade. You'll still have a core, a handle, and a pommel so it saves you much effort. Hope this helps, and good luck!