Is there a reason why a wire coil inside of an iron pipe wouldn't work as an electromagnet?
Yes. Conventionally the core concentrates field lines generated by the coil wrapped around it. The return path is through the air, so field lines extend a considerable distance from the core allowing it to attract ferromagnetic objects. In your geometry, the return path of lines from the pipe is through the center of the coil. The field falls away rapidly with distance, making it basically suitable only for sticking to a thin plate. A simliar geometry is used for permanent magnets intended to stick onto sheet metal--magnets in the base of removable car radio antennas, e.g.
Separate names with a comma.