Bottom line up front: like a lot of questions in the law, the answer is, it depends.
In March 2016, our highest military appeals court, the U.S. Court of Appeals for the Armed Forces, dealt with an Army Second Infantry Division regulation that prohibited providing alcohol to fellow Soldiers under the age of 21 (United States v. Gifford, No. 15-0426/AR). Specialist Gifford was stationed in Korea with that unit, and he was found guilty of violating that regulation. The question before the court was: did Specialist Gifford have to know that the persons to whom he provided alcohol were under the age of 21?
Our highest military appellate court said, yes, he did, and thus overturned the decision of the intermediate appellate court, the Army Court for Criminal Appeals. The rule in these matters is that the government, to obtain a conviction, must prove beyond a reasonable doubt by legal and competent evidence that the accused Soldier at least acted recklessly in regards to his knowledge, or lack thereof, of the young age of those Soldiers to whom he provided alcohol.
That rule does not apply universally to offenses involving prohibited conduct with minors. For example, it is forbidden under certain sections of the Uniform Code of Military Justice to engage in sexual conduct with minors, and the accused military member's knowledge, or lack thereof, of the age of the alleged victim is not an element of the crime and thus a matter that the Government must prove. As always, a Soldier, Sailor, Airman, or Marine engages in sexual conduct with another at his or her own peril.
That is why it is so important to seek legal counsel if you are ever charged with misconduct in that military justice system. Make no decision when approached to be questioned, or when charged with a crime, without first consulting an attorney. All the military services provide legal counsel at no charge at such times, and there are many well-qualified “civilian” attorneys to help you make sound decisions and remain safe from unjust prosecution, unlawful interrogation, or trumped up charges.