What did pangolin scales evolve from?
Pangolin scales are certainly not retained from fish. Pangolins are within the clade Pholidota (Tree of Life page for Eutheria) and their nearest relatives are anteaters, sloths, and armadillos.

According to the University of California Museum of Paleontology, similarities between pangolin and armadillos are the results of convergent evolution. So the pangolin scales are a new feature that arose somewhere on the lineage leading to pangolins.