I don't think it will protect the inside unless the anode is connected to the corrosive medium inside the pipe, to complete the electrical circuit. But if the anode is external (which it usually is, whether impressed current or sacrificial anode CP is used), the only way the anode can 'see' the internal fluid is if the pipeline has a hole!
However, for export pipelines, the stuff inside the pipe is usually dewatered etc so there should be less oxygen corrosion inside...for flowlines with highly corrosive reservoir fluids, clad and internally lined pipelines are used.