Yes, except I was always the one wearing the uniform. I was already retired when I started having gay sex, but guys would ask me to wear one of my old uniforms for their benefit.
Did nothing for me, but it would really turn the other guy on. Most times they'd ask for my BDUs (camouflage) with boots, but a few liked my dressier uniforms, hat & all. (Pic below of my Army dress blue cap)
The BDUs had a button fly, which guys seemed to have more fun undoing than the zipper of my dress trousers. Suited me too, since a metal zipper could be painful, all these guys wanting to suck me or get fucked while I was otherwise fully dressed, just my dick sticking out through the fly.
My US Army dress blue cap, field grade rank of Major through Colonel. Green & gold decorative band denotes a Military Police Corps officer.