They are very different graphics APIs. But it is fair to say that they basically do the same thing. DirectX is probably the preferred API if you are developing a game under windows (or a game for XBOX), and OpenGL is the choice if you want to use cross-platform support. Mac OS uses GL, just like the iPhone, for example, and many Windows games also support OpenGL.
OpenGL " ", - API , . OpenGL ES; .
DirectX, , Microsoft, , , "" ( COM, ). MS API .
(, iphone DX). /. , , , ...