The short answer is, yes it definitely is possible to come up with excellent buds starting with seeds from a bag of mediocre weed.
Some of the seedy Mexican "schwag" stuff has pretty good genetics, actually better than some commercially available strains.
The problem with it is that these plants are grown outside with males so they get seedy, harvested before they hit peak potency, cured badly, pressed into bricks for smuggling, exposed to all kinds of harsh storage conditions for who knows how long, then crumbled into pieces for street sale. So of course you're not getting the full potential of the plant that way. If you take the same seeds, only grow the plants seedlessly, harvest them when they're actually at their peak, and then cure them properly, what you end up with can be WAY better than the stuff in the bag you started with to the point where its barely recognizable as the same plant.
If you think that's the case with the seeds you have, that they just were grown carelessly, harvested and cured badly, etc, then yeah, you might end up with something great.
If all you have are these bag seeds, then sure, plant them. At worst, they'll make good "practice" seeds while you are learning how to grow, setting up your garden, and saving up your pennies for top-level genetics. There really are two caveats here:
-Ultimately you're going to be limited by the quality of the genetics you're starting with. If the strain is crap, all your work is not going to yield much. So if you have limited space/time to grow, and you have seeds you KNOW are excellent, then it may not pay to take a chance here with unknown seeds.
-Before starting you don't really know what you're going to get. So you don't know how long its going to take the plants to flower, how stretchy they might be, how much they might smell, etc. Its a bit of a crap shoot that way.