Both of these nouns are related to the English word order, but in different ways.
An ordinance is a kind of order (a command) in the sense of a law, rule, or regulation. Ordinances can be made by city councils, boards of supervisors, or other governing bodies, and are typically designed to protect the public health, safety, and welfare:
Starting in January, a set of controversial ordinances will go into effect in the city of Chicago, focusing on environmental health and safety.
Ordnance, in contrast, refers to the things that are ordered (arranged) in order to wage war— weapons—including guns, bombs, tanks, bullets, warplanes, or any military equipment with destructive power. Ordnance is a mass noun, like water or air, so you cannot say an ordnance, or many ordnances:
The general hoped all the ordnance he ordered would arrive on time.
Note that, as a mass noun, ordnance is not pluralized.