id always managed to do it and still produce games that everyone considered the benchmark of their generation. Sound and input would probably be the most divergent and if you use something like SDL even that can be abstracted away from the platform.
Yep and Id did just that for it's newer games. I don't know if they used SDL for Doom3, but they (well them and raven or whoever) definately did for Quake4 stuff.
SDL is especially good for games. It not only targets Microsoft DirectX, OS X, and Linux, it supports other targets like Playstation 2 and such. It provides a way to do accelerated graphics, 3D acceleration, media, surround sound, and input/output and is much more easier to work with then DirectX or anything else.
Unreal Tournament 2004 uses SDL exclusively for their Linux stuff. The port was done to Linux by a single person on his spare time. He took the windows code, tried to compile it with gcc and fixed the bugs that cropped up until it compiled cleanly. That's what he had to do for 90% of the port. He did that for essentially free and it ended up netting people that made UT a huge contract with a Japanese arcade gaming company because they built their arcades on and around Linux. Essentially it was free money.
Doom3/Quake4 uses OpenGL for graphics and SDL for everything else. Everything is cross platform and it can target OS X, Windows or Linux without a huge amount of work.
It's a little thing called 'Standards'. OS X supports them, Linux supports them, Microsoft abuses them. Except for the 2D GUI code for front-ends programming for OS X and Linux is essentially the same, especially when it comes to games.
Other stuff for Linux and OS X is fairly easy.. For example they both can use X Windows. They both use CUPS for printing. They both support POSIX standards. They both are compiled, and the majority of their application code is compiled, with GNU utilities and GCC. Once you done most of the work of supporting either Linux or OS X the only remaining expense is adapting UI to each other.. which if you did your application correctly shouldn't be a big deal.