It really depends on the size of the dragon. If the dragon is huge or larger, then quite frankly, I see it this way:
You are walking down the street when someone spits a freshly chewed wad of bubble gum on you. Does it constrict your movement in any way?
If the dragon were of such a size to be confounded by a normally-sized tanglefoot bag, then I could see it working possibly. However, if the dragon were sufficiently large, it shouldn't even slow him down.
EDIT - I just checked a few facts:
1) A tanglefoot bag is the size of a belt pouch! Tell me that any alchemical goo in something that size will affect a huge creature. Yes, I know size limitations are not mentioned in the rules for it, but frankly plausibility prevails to me here.
2) If the save is made, the creature still moves at half-speed. This is still enough for a dragon to fly with.
3) A strength check versus DC 27 is tough, but still quite doable for a dragon of adult size or larger.
Bottom line - if this dragon was adult or larger, chances are your PC's have no leg to stand on.