The OED shows references to “zeroing” a rifle (without the “in") from 1913. The “zero” seems logical enough in terms of adjusting the sight or scope so that the difference between the point aimed for and where the bullet actually goes is zero.
1913 A. G. Fulton Notes on Rifle Shooting 30 (advt.) A Zero Target, by means of which any novice may correctly zero his own rifle.
1918 H. W. McBride Emma Gees ix. 119 ‘Zeroing’ a rifle is the process of testing it out on a range of known distances and setting the sights to suit one’s individual peculiarities of aiming.
First OED citation for “brass hat” as an officer is this:
1887 Belfast News-let. 16 Mar. 7/4 Three officers..are to be tried by general court-martial for practical joking to a most unwarrantable extent with one of the brass hats of Dublin—we mean a staff officer.
but there’s also an earlier “brass-hatted”:
1858 Freeman’s Jrnl. (Dublin) 10 Nov. 3/7 The blue-coated, pewter-buttoned, brass-hatted army is upon them in a moment.