OK to use short length of plumbing pipe as electrical conduit?
You can use rigid as the ground it is done absolutely all the time. However both black iron and water pipe are code violations (how would anyone know?) The water pipe has a seam that is not smooth and the black iron is not galvanized. Rigid conduit uses the same dies as regular pipe if they have a machine there is no difference.
The big deal is the center needs to be chamfered, some don’t do this on water and gas.
you can connect the boxes and use the pipe as your ground. from the pipe size why not pull the ground in the pipe the nuts are cheaper than a short run of copper.