Can I replace one with the other? L7805CP, L7805CV
The difference is in packaging.  The L7805CP on the left is an all plastic package.  the L7805CV, on the right, has a metal tab.
As long as your application doesn't depend on the ground connection on the metal tab, it should work.