Out-of-universe, O'Brien's rank and status as an enlisted man was inconsistent early in TNG. But in-universe, Starfleet captains appear to have the ability to name non-officers acting officers. Most notably, Wesley Crusher is named an acting ensign and given a bridge officer position despite not even being in Starfleet.
PICARD: Commander Riker has told me how supportive you were in
Engineering. Well done. At ease. Sit here in Command.
RIKER: Captain, it's not allowed. Your orders.
PICARD: Oh, that's true. Well, I can't waive them again. Only
commissioned officers.
WESLEY: It's quite all right, sir, I understand.
PICARD: Please don't interrupt me, Wesley.
WESLEY: I'm sorry, sir.
PICARD: Any commissioned rank? Even ensign?
RIKER: That would give him authorised access to the Bridge.
PICARD: Well, then, I'll have to make him an acting ensign. Captain's
log, stardate 41263.4. For outstanding performance in the best of
Starfleet tradition, Wesley Crusher is made Acting Ensign, with the
duties and privileges of that rank. And whether that rank becomes
permanent, Mister Crusher, depends on you. At the earliest
opportunity, your entrance application for Starfleet Academy will be
tendered. Until then, you will learn this ship. Every operation, every
function. Commander Riker, a duty schedule for Mister Crusher, heavy
on study. (Where No One Has Gone Before)
Picard later gave Wesley a field commission, promoting him from acting ensign to full ensign.
PICARD: The Academy must make you wait, that's true. But, when I review your service to this ship, your crewmates, I cannot in all conscience make you wait for the Academy. You see, Wesley, in my eyes you're an acting ensign in title only. I hereby grant you field promotion to full Ensign, with all the commensurate responsibilities and privileges of that rank. Congratulations. You're dismissed. (Ménage à Troi)
Likewise, Star Trek 2009 features the bulk of the cast serving as acting bridge officers even though none have graduated Starfleet or earned a commission, while Voyager sees Chakotay and Paris receive temporary commissions despite being kicked out of Starfleet entirely.
If a teenage boy can be named a full ensign in peacetime at Picard's discretion, it's not a stretch to imagine that O'Brien was given a battlefield promotion to a bridge position at the height of the Cardassian War.
Once the Captain has made up his mind the discussion is over.
. – Edmund Dantes Jan 11 '19 at 8:17