The AVI container doesn't actually support the modern features of MPEG-4 codecs (XviD, DivX, especially H.264), like B-Frames, subtitles, etc. Decoders use hacks to get around the limitations of AVI, and the result is basically a compatibility clusterfuck of epic proportions between various players.
You can learn more from these articles:
http://en.wikipedia.org/wiki/AVI
http://en.wikipedia.org/wiki/Comparison_of_container_formats
For example, was a thread
here about someone not able to run an H.264 in QuickTime. The problem wasn't with QuickTime, as QT actually has a perfect, industry-standard implementation of MPEG-4 and H.264. The problem is the AVI format you wrapped it in, which isn't compatible.
A little history lesson on MPEG-4.
You can think of MPEG-4 a lot like MP3. Any MP3 player will play MP3, right? It doesn't matter if it was encoded with the official Fraunhofer encoder, ffmpeg, LAME, or anything else, it "just works" and plays anywhere.
This is actually how MPEG-4 was designed. Any MPEG-4 codec, whether it be DivX, XviD, Nero, Apple's MPEG-4 codec, 3viX,
whatever, will "just work" on any MPEG-4 implementation.
The key is putting it in the container it was designed for. Putting MPEG-4 in an AVI is like putting a JPEG in a TXT file. The container for MPEG-4 is... drumroll... MP4.
http://en.wikipedia.org/wiki/MP4
So right now you can make an XviD- or x264-encoded MP4 and it will just play in QuickTime, iPod, VLC, ffdshow/DefilerPak, XMBC, MPlayer, etc., because that's what it was designed to do. Some players/codec packs like VLC and ffdshow/DefilerPak also go out of their way to support the AVI hack, but it's best not to encourage the black sheep.
You can liken it to the current Internet Explorer 6 versus Everything Else battle today on the web. Except the metaphor would have to be that 100% of people browsing the web are using Firefox, but web developers continue to code for IE, so Mozilla just writes an IE compatibility layer into Firefox, and everyone continues traveling along this retarded fucking detour. It's truly fucked up.
Bottom line:
There is absolutely no reason to use AVI anymore. Anyone who can play the hack can also play MP4, so using AVI only limits the people who can play it.