There are many differences. XviD (and DivX for that matter) are MPEG-4 inspired codecs. But they are not true MPEG-4 since they came out before the MPEG-4 specification was completed. They also only implement a subset of the features and functionnalities.
Now be carefull not to mix MKV with H.264. MKV is only a container. It can contain anything (from DivX, to H.264 and many others)
H.264 is a fully MPEG-4 compatible codecs. For the full technical details, you should read the documents on H.264. But the idea is that H.264 presents a better compression ratio (smaller files for equal quality) and is capable of delivering higher quality than DivX or XviD.
now its up to u what do u want .best of luck