Question: Specifically stackoverflow and serverfault.

Is that possible? It sure would be convenient for scripting purposes.

Answer: 
I would LOVE to see this happen. I realize that it's probably too late in the game to change the user IDs on ServerFault, but back when it was first announced I had the idea that a user would have a single account (with, incidentally, a single ID) that existed on all the sites. Separate posts, rep, badges, etc. but basic user info would be the same across the sites.

Not only would it have made it easier to provide a unified rep tracker, but it would also eliminate some of the headache that goes with migrating questions from one site to another and trying to preserve ownership of the content.

However, it looks as though Jeff is trying to right this mistake with Meta by prepopulating the site with the current users from SO and SF, and is [actively looking into](https://meta.stackexchange.com/questions/2/sync-meta-user-accounts-daily-with-other-family-sites) keeping the data in sync. So I guess we can probably expect that SuperUser and whatever other Overflows come down the line will enable users to retain their IDs from whatever sister site they're a member of.
From a database perspective, this seems impossible at this point (well, not impossible, but practically given the amount of work necessary).

I imagine that user id is the identity field in the user table and it serves as a foreign key to other information stored in other tables. So changing that user id would mean changing data all over the place.

It might have been a nice to have, but at this point seems unlikely given other priorities.