Well, as with so many things academically, it depends on where you're looking.
In general (exceptions noted below) the MDiv is the basic degree a seminary offers. The MDiv is usually about 90 hours and is similar to the JD and MD in terms of length of study (though, sadly, often less rigorous than either of the two.) The general structure of the MDiv is to prepare a candidate for vocational ministry by equipping them with course in biblical studies, theology, philosophy, languages, and so forth. It is a robust professional degree.
The Masters in Theology can refer to two different degrees. One is the Master of Arts (MATh) in Theology which is usually a Masters that is around 45 hours with thesis. The other is the Masters in Theology (ThM) which is about 30 hours with thesis. The MATh is a research based degree that has little core components and the structure is up to the student like many other masters degrees in other field. (I don't think this is the one you're asking about.) The ThM is a one year theologically intensive research degree tacked onto the end of MDiv study to give a more focused research time since so much of the MDiv is built on professional studies. The ThM always (with one, noted below, exception) requires an MDiv as a prerequisite. It has a thesis, usually, which ends up being an extended, focused study on a topic that one will likely use for entrance into a PhD programme. Most PhD programmes don't accept the MDiv as a stand alone degree unless special circumstances permitted more focused research study.
The one exception to the ThM (that I know of) is Dallas Theological Seminary where the ThM is the basic degree and is 120 hours. It contains all of the components of an MDiv study at other seminaries but adds language and theological studies.
Unless you are speaking of going into DTS' programme, I've never seen anyone be able to get into a ThM with just an undergrad.
Hope that helps.