It comes from the trench warfare of World War I, and the
implication was that it would be good fortune only to get mud from the
trenches in your eye, all the other very real possibilities, such as
artillery shrapnel, being absolutely horrific.
It may come as a surprise but in all truth mud also existed in Vietnam. The picture on the left is of a major supply road inside the firebase named C-2.