I remember a documentary about the relationship between officers and NCO' s in the Marine Corps. Basically it boils down to what DH says: officers give orders and set policy, NCO's see that they are carried out. As far as the relationship in terms of young officers ordering NCO's about, it's a little more complicated than that. If you think about it, the young officers are seen as go-betweens for the senior officers who set the goals and objectives and the troops. Thus a sergeant isn't really giving up any dignity by following orders because he knows who's really giving them. On the other hand, a young officer who tries to cross the line between passing on what
needs to be done and telling an NCO how
to do it, is probably asking for a considerable amount of resentment and subtle contempt.
If the writers had really wanted to put O'Brien somewhere just outside the command structure box, they could have made him a warrant officer. Warrant ranks are traditionally issued on the basis of merit to deserving enlisted personnel. Compared to a regular commission they are career dead ends, since you can't make general or admiral on that line, but it is a way of giving the equivalent of commissioned officer's privilege and pay to people who otherwise would be stuck in the senior NCO ranks. Unfortunately the only person involved with any of the Trek franchises who probably understood that was GR and he didn't even want enlisted personnel...he figured Star Fleet was an elite organization and that anyone serving on a star ship would be a commissioned officer.