Comes (plural: comites). Literally means "companion" but for some reason translated as Count. In the Principate, the high raking members of the Imperator's retinue who travelled abroad with him were termed "companions." Later, Diocletian applied the term to his senior cavalry unit. Constantine gave it the final form - a title bestowed in 3 grades to members of his imperial court. Most of these offices were marks of personal favor applied to petty sycophants and couriers. However, some Counts actually had posts with real power in both the civil and military apparatus. In the civil service, Counts were usually in charge of finances. In the military, Counts could lead small detachments of the mobile field army. The Vicarius (governor-general) of the prestigious Eastern (Oriens) diocese was also a Count.
Dux (plural: duces). Meaning "leader" but usually translated into English as "Duke." In the Republic, a term applied to commanding generals. In the empire it came to mean someone who commanded a detachment of troops, and was often used for allied barbarian leaders. Under Diocletian the military and civil powers of most provinces were separated. The governor retained civil powers, but the military powers were now headed by a dux.
In military terms, a Count led a small detachment of the mobile field army. A Duke was the commander of the stationary garrison in frontier provinces. I've read conflicting reports about who outranked whom, but most of the latest scholarship seems to suggest a Count outranked a Duke. Both of course were under the authority of a Magister Militum (Master of Soldiers).