Tunnels are very powerful if some cards are present, such as Warehouse and Storeroom. However, when you draw Tunnel without them in your hand then Tunnel is another dead card (and then Warehouse will have to discard other cards for no effect).
Some cards that allows discarding, to illustrate Cartographer, Navigator, Oasis, Tactician, Catacombs, may not work perfectly with Tunnel. Cartographer and Navigator can discard Tunnel NOT in hand (so Tunnels in hand are dead). Tactician may force you to discard good cards (Gold) along with Tunnel. Catacombs may draw Tunnel in 4-6 next card of the deck. Venture, Golem, Adventurer does not guarantee discarding Tunnel before finishing revealing cards. (While Golem is still viable if you've at most 1 non-Golem action) So, with the presence of these cards it relies on your luck too, not always cause you to gain Golds.
It may not be a counter to discard attacks because you cannot rely on them playing when you've this in hand (and your opponent may declines to play it). The exception may be Goons that its +VP per buy is powerful.
To conclude, not every kingdom with cards allowing discarding causes Tunnel's reaction viable. And even with lack of discarding, Tunnel is only bought around the endgame for 2VPs only.