Most modern buried pipelines are coated with an organic coating that is supplemented by a cathodic protection system to prevent external corrosion. The coating protects most of the external pipe surface and the cathodic protection system prevents corrosion at the gaps or holidays in the coating. Both the coating and the cathodic protection system protect only the external part of the pipe. The internal surfaces of the pipe will receive no protection even if the pipe contains a conductive material. This is because the pipe intercepts the current and carries it back to its source. Cathodic protection systems can do more harm than good if they are not designed and installed properly. I suggest you refer to a standard, such as NACE SP0169 "Control of External Corrosion on Underground or Submerged Metallic Piping Systems," for more information.