Is the word *command* a noun in this sentence or only the object of the preposition?

"Seals balance balls on their noses on command."

Yes.

It's a noun by part of speech. It's also the object of the preposition.