Like Steve said, "it depends." In some circumstances, you can pull value off of people who are displaying exploitable betting patterns regardless of the cards you're holding.
Let's say you notice that someone to your right is min-raising a lot pre-flop and calls 3-bets almost always, then folds to any raise to his post-flop bet unless he's hit the flop fairly well or has an overpair to the board. A player like this becomes really easy to read after a while, since we know that non-pair
hands miss the flop the majority of the time, and small-middle pairs will often be looking at one or more overcards on the flop.
If you're sitting to the left of a player like this, and I've seen a couple of people who play this way, the cards you're holding become largely irrelevant because you want to see flops with this guy. All you have to do is raise him when he bets the flop and he'll tell you right there whether he has something or not because he'll fold if he doesn't.
This is an extreme example; people who play like this usually empty their bankrolls very quickly and you won't see them stay for long.
Take a typical speculative hand like 76 suited in various tournament situations. On the button at a full table, low blinds, and there's multiple limpers ahead of you, there's no harm in limping in as well and see if you can hit that long-shot flopped straight/straight flush.
High blinds, UTG, full table, you're dealt 76s and you have ~15 BB? This should be a fold.
High blinds, 3-handed, you're the short stack on the button with 76s and 5BB? Time to push.
Even the value of 22 changes drastically taking only position into account. There's no one single answer to your question, extracting max value from marginal hands takes a lot of study and experience.