DirectX is made by Microsoft, for Microsoft. There are some Linux emulators in the pro version of Wine. But best shot is still a Windows PC or XBox with a modern graphics card (currently Radeon has the most up-to-date drivers with all modern DirectX features and some special hardware in it). To use the latest DirectX (v.12) you are forced to also use Windows 10.
History:
During the 1990s some early 3D APIs emerged. One of the first was OpenGL which was made by a consortium of companies and first released in 1992. It was mainly pushed by 3D research, e.g. in Virtual Reality labs (e.g. IRIX running Unix workstations) and in some games (Quake, 1996) used it too.
In the 1990s Microsoft was part of the OpenGL ARB (the consortium - today known as Khronos group), but then they created their own 3D API called Direct3D and left the OpenGL consortium. Direct3D is/was a subsystem of the DirectX framework (there are some more things like audio, game servers etc.).
Since games were now almost all sold on Windows from the mid 1990s onwards, this was a simple coup, a good old company-will-dominate-whole-market thing.
Since the 2000s, OpenGL was mainly found in research (Virtual Reality labs) and CAD applications in 3D workstations, whereas all except Sony (and maybe some other companies) used DirectX now.
One of these “other companies” was id software (Wolfenstein3D, Doom1, Doom2, Quake1, Quake2, Quake3, Doom3, Quake4 - all beginning with Quake1 were using OpenGL). They pushed OpenGL in terms of gaming (e.g. Doom3 was the first game that made heavy use of normal maps and stencil shadows).
Even today still over 90 percent of PC based gamers use Windows (and hence DirectX). People playing on Linux is a very small minority. People playing on Mac (e.g. in the U.S.A. where Apple seems to have a significant market share) are still a minority (but a growing one).
Smartphones (except maybe Windows Phone) use OpenGL ES, Steam Machines, Playstation, maybe Nintendo don’t use DirectX - so it has returned to that more balanced situation during the last 5 years - but only if you include phones and consoles.
On the gaming consoles far more than 50% (more like 70 or 80) do not use DirectX. This is because Playstation4 sold better than XBox and there are some other consoles not using DirectX.
It’s all an up and down and history will tell what kind of 3D API will dominate the future (might as well be OpenGL or one of it’s successors like Vulkan).