Is there any way to replace the ps3 hdd with an m.2 ssd?

Even with normal ssd there probably is some Tb limit in the OS which you should research first, also the PS3 isn't fast enough to take advantage of a very fast drive.
Yeah apparently it has a hardware limit of 1.5tb. I made a post on the Linus tech tips forums, and someone helped me out.