Overwatch doesn’t really have hard counters.
Certain heroes have advantages over others, but that doesn’t mean that you can’t win against those with advantages, it’s just harder to do.
Bastion shooting in Defense Matrix isn’t a hard counter, it’s just being stupid. Timing and waiting for D.va to bring down her matrix helps maximum his damage.