Some cards are very dependent on the actions your opponents, and some are not.
e.g. buy Tribute if you see your opponent to the left buy lots of different cards, don't buy it if they are not.
However, in most cases, if your strategy can be influenced by opponents actions, then it is best to proactively consider those potential influences even before they are made. You cannot quickly change strategies in dominion; once you commit to one, your course is mostly set.
Embargo is an example: when your opponent starts to pursue a strategy that requires many cards of a particular type, e.g, Conspirators or Cultists, then you can buy embargo to stop them from acquiring those cards.
Conversely, if your opponent would be able to disrupt your strategy with an embargo, it is probably a bad idea to pursue that strategy in the first place.
Or take Young Witch: if your opponent buys lots of bane cards, you probably do not want to buy young witches, and if your opponent buys lots of young witches, you want to buy bane cards.
But if the bane is a card that your opponent can easily buy without disrupting their flow, then buying young witches is a bad idea even before your opponent starts reacting to it.
Or take Possession: If your opponent buys possession, you definitely do not want to buy any Masquerades or Ambassadors, and need to get rid of your existing ones as soon as possible, because if they possess you while you hold one of these in your hand, they can steal your provinces.
But if you see that Possession is on the board, you may want to hold of on buying those Masquerades and Ambassadors in the first place. (Thought Ambassador and Masquerade are both very strong opening cards, so you may still want some anyway).
The point is, an optimal strategy has to consider all the potential actions of your opponent, so it will most likely only need minor tweaking based on what your opponent actually does.
There are lots of specific counters that work well against a particular card: Jack of all Trades vs Ghost Ship, Minion vs Alchemist, Monument vs Possession. But in most cases, if a card can easily be countered, you should not buy it in the first place. So if everyone plays at a high level and avoids mistakes, there is little need to react to your opponents actions after they make them.
Some general guidelines:
If you see your opponents going for a strategy that will get them a lot of points, but will take a lot of time, you are best served in pursuing a strategy that nets less points over time, but can end the game sooner.
I.e. if they ramp up their engine to buy all the provinces in a single turn with a mass bridge combo, buy some provinces and try to end the game on three empty piles.
If you see your opponents in a 4+ player game buying lots of attack cards, focus on buying cards that help you instead of hindering others, since your opponents will take care of attacking each other for you. When three other players distribute curses, you will only get slightly more curses than the other players if you refrain from distributing curses yourself.