A youth boastful of his vast knowledge, he wields strength befitting a knight, yet heavily relies on logic.
—Dissidia 012 description.
A youth bearing the title of Onion Knight. Intelligent and mischievous, he unquestionably believes there’s nothing he can’t do.—Dissidia Final Fantasy description.
The Onion Knight is one of the four orphans from Final Fantasy III. But his appearance refers to the job class the youths start the game.
Cloud of Darkness: [laughs] “The legendary Onion Knight. A title far too grand for a child such as you. Do you not understand who caused this to happen?”
He’s male, but not any of the characters from the remake. At best, he represents out characters in the job classes. So then, if he’s not Luneth, Arc or Ingis, where was he in Final Fantasy III?
The events in Final Fantasy III transpire the same, regardless of the characters. So then when did Cosmo call the Onion Knight to World B? Final Fantasy III starts with his descent into a pit. An earthquake opens up an entrance to Altar Cave near the village of Ur. In the original Final Fantasy III game, the four orphans explore the cave. There, they find the Crystal of Wind, which later transports them to the outside world. Perhaps in that split second, the orphans merge into the ideal representation of the Onion Knight.
Another scenario happens on the surface world. They bring the light of the crystals to the world where, again, an earthquake strikes. The characters awake to find the surface restored from a swirl of darkness with only two visible islands. Before they awake, the light of the could have transported them to World B.

A final scenario is the orphan’s fight against the Cloud of Darkness. In their first battle, the Cloud of Darkness kills each of the orphans. This might be how the Onion Knight knows of it, and why it has certain trepidations against fighting it:
Onion Knight: “I can defeat the Cloud of Darkness with someone’s help. If only I weren’t alone… But Terra would continue to suffer while I go looking for someone… –Standing still isn’t going to solve anything. I’ve been saying so myself…”Onion Knight: “I know I have to save Terra. But to have to fight her… I don’t know if I can win– What should I do? What’s the answer? The right answer?”
Onion Knight eventually defeats the Cloud of Darkness. Cloud of Darkness returns to the Void, while Onion Knight returns to his world, resurrected by Doga and Unei.