Yes, it's possible
The bag of holding opens into a nondimensional space: Its inside is larger than its outside dimensions.
All that truly occurs with a bag of holding or similar items is that they are in a pocket dimension of finite space. As long as the creature has a fly speed to reach the opening, which depending on the bag type can be as far as (roughly) 250' without getting into the algebra. Now, if the players are waiting for the construct to try an escape, they can have a held action to perform an attack of opportunity, most notably a grapple to stop it from escaping, but if they aren't expecting it they are flatfooted and thus have no recourse when the critter breaks free unless the DM in question gives them a Reflex save for some reason.
However, you can also argue that if the lighting and sounds on either side of the bag are the same, then the construct may need a Perception check to notice that the bag has even been opened.
But! The main concern I would have is the following:
If the bag is overloaded, or if sharp objects pierce it (from inside or outside), the bag ruptures and is ruined. All contents are lost forever.