The word ox comes from the Old English oxa. In Old English, whichas in Indo-European languages in general (historically and even today), the number of a noun (singular or plural) and its function in a sentence—whether it was the subject, direct object, indirect object, or had some other relation to a verb or another noun—was largely declined according(not solely) governed by sets of endings tacked onto it, or changes made to what'sthe vowels in it. These sets of endings or changes were called declensions, and each type of relationship associated with an ending is called a case.
There were the weak declensiona number of declensions in Old English; the two most prominent were the weak declension, containing the weak nouns, and the strong declension, containing the strong nouns. Its Old English oxa was a weak noun. The forms that we have of its descendant today are derived from the nominative case endings; these are the forms that would indicate that a noun is the subject of a sentence, or the forms that would be used when writing a list of nouns.
Since oxa was a weak noun, its plural form (nominative)the nominative plural form) was oxan. Over the course of centuries, the a "weakened" to an e, giving us oxen.
Fox, on the other hand, comes from the Old English fox, which was declined according to thea strong declension;noun; its Old English plural was foxas, whence we get foxes.
The source I used to confirm the declension of fox has an entry for the Old English box; however, it has no declension information. Using this translator, however, it appears that the nominative plural was boxas, giving us boxes.
Although Modern English has largely dropped the declensional suffixes we got from Old English, we occasionally see them peeking through, as we do here.