Viper's on the right track here. In many ways, this is like comparing apples and bolts.
MPEG 1 or 2 is a fully defined video spec. It dictates the way the video is compressed and stored. There is some latitude in the audio, but in general MPEGS are a known quantity. There is also leeway under MPEG2 to do heavier or lighter compression. This can result in better or worse quality.
AVI, on the other hand, is simply a container format. This means that it does not dictate anything about the video or audio streams that are contained. Their quality is entirely dependent on the underlying compression that is used. Popular compressions are DIVX & XVID for video.
The point of your question, though, is clear in my mind. What you are probably asking is "which is better: MPEG2 or DIVX/XVID" (if I'm not right in this assumption, respond and say so).
My answer (as usual) is "it depends".
MPEG2 is better since it is universal and the basis of DVD. Author one of these, burn it, plunk it in the player, and it works!
DIVX/XVID is better since it is so compressed. You can fit a full movie on 1 or 2 CDs (not DVDs), or several on one DVD.