Outside of cavalry troopers in the 19th century, military troops got a rifle/carbine or a sidearm. Prior to the 20th century, officers could carry personally owned handguns and this tradition continued on in certain units [a friend who was a Phantom II driver in Vietnam carried a S&W highway patrolman] and nearly everyone is aware of certain Generals wearing non-standard uniforms and handguns.
Some company/field grade officers felt better wielding shoulder fired weapons and would acquire them in theatre, often seen during WW2, Korea, and Vietnam. Enlisted soldiers/Seabees/Marines picked up war trophy handguns in the past, but rarely were allowed handguns unless mandated by their MOS/rating and their officers allowing it.
Some company/field grade officers felt better wielding shoulder fired weapons and would acquire them in theatre, often seen during WW2, Korea, and Vietnam. Enlisted soldiers/Seabees/Marines picked up war trophy handguns in the past, but rarely were allowed handguns unless mandated by their MOS/rating and their officers allowing it.