.mpg files should play just fine in quicktime player, I don't believe you need to do anything.
.avi files are often divx/3ivx compressed and need a special plug in or another media player such as VLC or Mplayer.
This topic has been discussed many times before, so if you do a search I'm sure you'll find your answers in full.