What knife is available in a choice of VG-10 or D2?
Anyway, D2 is very hard and very wear resistant. This means it stays sharp for a long time. This also means it takes a long time to sharpen. Very long.
VG-10 is pretty easy to sharpen, and it takes an absurdly sharp edge. Edge holding is pretty good. Slightly less than S30V, which is slightly less than D2. That's a broad stroke though, and might vary between makers.
In use, the two are pretty different steels. D2 is probably a better choice for a hard use/working blade. A lot of this has to do with the grain and carbide structure. The carbides compared to other steels are huge. Something like 15X those in ATS-34, if I remember what I read correctly. This means getting that super sharp, polished edge on D2 will be difficult, if not nearly impossible. However, this gives it great durability. Especially on materials like cardboard (which dulls knives like sandpaper), D2 will outlast many steels.
VG-10 also has somewhat unique characteristics. Keep in mind that VG-10 is one of the few steels that was actually developed specificially as a knife steel, not just some other steel cross-applied to cutlery. VG-10's grain/carbide structure has an almost inherent saw-like property to it. This means it can get extremely sharp, especially to certain materials. Fibrous materials like plant matter (and wood) and cardboard are cut very easily with VG-10, as well as (sometimes rather unfortunately) skin and flesh. VG-10 easily is the most "wicked" of steels whent it comes to sheer sharpness (at least in my experience). And although it wears (dulls) a little quicker than S30V or D2, it still has what I would consider "excellent" edge holding properties. And it sharpens much easier than them too.
I'm still a bit confused why you're comparing these two steels, because I can't think of any knife that is offered in both VG-10 or D2. Which makes this discussion a bit accademic, because the kind of steel is only one aspect of a knife. Two different knives in the same steel are going to cut differently even though the steel is the same. Just as important is the geometry of the blades and the specific company that makes the knives.