M2 is tougher, finer grained, easier to sharpen, and easier to rust. D2 is difficult to sharpen (takes a long time), larger grained, and not very impact resistant. D2 has 12% Chromium, and normally "stainless" steels have at least 13% (154CM and S30V, both premium steels have 14%). Compare to this to M2 which has about 4%. D2's large grain structure means that it won't sharpen as finely as some other steels, but will give a nice toothy edge that's great as a working blade, especially for plants or cardboard.
All mumbo-jumbo aside, what it mostly comes down to between D2 and M2 is stain resistance vs ease of sharpening. Unless you're working in extremes or doing scientific testing, you're probably not going to notice much difference in the performance between the two,