Roger is a word used in one prominent radio alphabet to stand for the letter R. These alphabets use words to represent letters; such alphabets are known as “radio alphabets” or “phonetic alphabets,” among other names, and are used for many different languages. The alphabet in which Roger stands for R begins “Able Baker Charlie Dog…,” and was the official radio alphabet of the U.S. Navy before 1954. Another familiar alphabet, the NATO phonetic alphabet, which is used by the International Civil Aviation Organization and the Federal Aviation Administration, begins “Alpha Bravo Charlie Delta”; this alphabet uses Romeo for R. There is a page devoted to these alphabets here.
The R that Roger is substituting for stands for received, indicating that a radio message has been received and understood. The use of radio-alphabet terms to stand for other words is common in the military; roger is a well-known example, and another example is Charlie referring to Viet Cong troops, which comes from Victor Charlie, a radio-alphabet spelling of VC for Viet Cong.
Wilco is not from a radio alphabet; it’s a military abbreviation for will comply, indicating that a message that has been received will be complied with. It’s necessary to acknowledge receipt of a message with Roger before indicating compliance with wilco, hence the frequent combination Roger, wilco.
Both Roger in this sense and wilco appear for the first time during World War II