I’ve been wracking my brain trying to remember a naughty bit of Jane Austen’s along those lines.
In the Italian military, the lower-ranking NCOs are still called “capo” , and in the French, “caporal”. So the first derivation looks favored if only from the word-structure. Proves nothing about the English form though, since the English may have just picked up the word and shoehorned it into a military organization not necessarily identical to the Italian. Or else something happened analogous to how “colonello”, on the way to becoming Spanish and English, picked up an “r” in both languages’ pronunciation but only one’s spelling.