I've owned multiple (fancy) rats as pets in my time. The species is somewhat split into domesticated and non-domesticated.
My rats would probably never have survived in the wild (due to their appearance, sand/tuxedo coloured, instead of just gray/brown), and likewise wild rats wouldn't be possible to domesticate.
There's quite a few videos on YouTube of the social skills they can develop. Quite amazing animals, but incredibly short lives. Most people who have them don't get new ones after the originals die because it can be so heartbreaking losing a pet every 2 years or so.