The standard seamed pipe is not a great choice. A seamless heavy wall pipe could do very well, but you would need to weld up the breech with a plate. The "cannon" that sounds colors at Camp Perry is made this way. About the size of a small mortar and fires a teaspoon of black powder with a newspaper wad. Good boomer. Two or three inch seamless pipe, I think? It's been too many years since I was up close to it.
If you don't want to invest in a firing replica cannon, you are probably OK as long as your pipe is overbore for the size of the powder charge. For example, where a .44 cap and ball revolver might use a 20 grain powder charge, you would probably want to use a 1" to 2" iron pipe for that same 20 grains. That gives it some expansion volume to minimize pressure. If you have some sandbags, you could do what the arms makers to and proof the thing. Put an intentional double-charge and fire it remotely from a pit surrounded by the bags. If it survives and a caliper doesn't reveal any sign of bulging, it is probably quite safe for your single charge loads.
My dad did build me a firecracker cannon from galvanized pipe when I was young. No threads at the muzzle. At the breech he sawed a wide slot by using two blades on the hacksaw at the same time. He made a carriage and wheels from wood, and the pipe inserted through the wood. The cap was removed at the breech, the firecracker inserted with its fuse in the slot, and the cap screwed back on so the slot has become the touch hole. No problem shooting firecrackers this way. I recall launching some loose fitting dowel rod sections and maybe a marble or two from it. I would consider those acts a bit risky today.