If I may offer some safety advice from the fireworks industry, fireworks mortars are now constructed using HPDE pipe. It is very strong and when it fails due to overpressure, it does so exceedingly gracefully. It bursts without throwing off shrapnel that can cause injury to more distant spectators. Typically the bottom is of the mortar tube on the ground or on a rack that is in contact with the ground and the bottom of the mortar tube is plugged with a wooden fitted plug.
Fireworks shells typically have lift charges under them that are black powder, with volumes of maybe 8 ounces for small (4") shells and increasing as the shell size increases. The lift charges are calculated to send the shell up about 100' for each inch of shell diameter. Fireworks shells are not heavy and sized to be a loose fit in the mortar.
So folks thinking of making a small cannon for "fun" might start by purchasing some HDPE pipe. Aluminum, steel, and even PVC sends out very dangerous shrapnel when they fail.
As to the legality, in Massachusetts you have to get a "cannon license". A friend who was involved in Revolutionary War reenactments has one. In NH, well its the Live Free or Die state.
Best of luck,
Wes