Mirror Axis and Rotation of Whole Object
If I understand correctly your question, it looks like you're confusing Global orientation with Local orientation. The Mirror modifier will mirror the mesh on the object's local X, Y or Z axis, not on the global X, Y or Z axis. So for example, if you mirror on the X (local) axis, here is what you have:



If I come back to Object mode and rotate the object on the Z axis, it won't mess up the mirror because my rotation was in Object mode and didn't affect the mesh on its own local axis. Here I've enabled the Transform Orientation display to make it clear, it displays the object own local orientation, you can see that it follows the object rotation, so the mirror effect won't mess up the mesh.



But if I come back to Edit mode and rotate the mesh on its Z axis it will mess up the object because this time I'm in Edit mode and the Mirror modifier takes the mesh local orientation into account!