It is true that the axes of the vertical milling machine perfectly match the right-hand rule. However, not all CNC machines follow the same setup. Horizontal milling machines require a shift in the axes because the spindle of these machines is in a different location.
Figure 1 shows the basic setup of a horizontal milling machine. As you can see, the spindle is located on the side. Because the Z-axis must always be parallel to the spindle of the machine, the Z-axis is tilted to the side, as shown in Figure 2. The X-axis still describes motion to the left and right. However, the Y-axis now describes motion that is up and down.
It may seem that the coordinates of this machine no longer match the right-hand rule. However, if you were to tilt your hand to match the worktable, you will see that the axes still line up appropriately.