For my pixel 2, while there were no technical restrictions preventing me from replacing the broken camera, the screen was glued in in a way making it very difficult to open without smashing. There were also no places to buy the camera other than what seemed to be cameras stripped out of broken/stolen pixel 2s.