Counterfactual reasoning is used all the time in the hard sciences. When you learn the formulas for gravity, the first thing you do is to answer questions like, “If you drop a rock off a 100-foot cliff, how long will it take to hit the ground?”
Dropping a rock from a cliff could also be called hypothetical reasoning, because one can easily imagine conducting the experiment. However physics also has all sorts of thought experiments that have no hope of ever being carried out. For example, explanations of relativity frequently involve spaceships taking people near the speed of light or being swallowed up in a black hole.
Counterfactuals are essential to the scientific method. Science is all about doing experiments that favor some hypothesis over some counterfactual.
The ability to make a precise prediction from a counterfactual is what distinguishes the hard sciences from the soft.
A famous example is Hendrik Lorentz's discovery of space and time transformations (now called Lorentz transformations) to explain the Michelson-Morley experiment. The counterfactual was aether motion, as Lorentz interpreted experiments to show that no such motion was detectable. He then used his formulas to predict relativistic mass, which was then confirmed by experiment. (Einstein later published similar theories, but the consensus of historians is that he paid no attention to the experiments.)
An example that failed to disprove the counterfactual was the 1543 Copernicus heliocentric model of the solar system. The established theory was Ptolemy's, but both theories predicted the sky with about the same accuracy. Experiments and models with much greater accuracy were achieved by Tycho Brahe and Johannes Kepler around 1600. The 20th century theory of relativity taught that motion is relative, and heliocentricity could never be proven.
Kepler's theory was superior not only for its accurate predictions, but for its counterfactual predictions. He had a complete theory of what kinds of orbits were possible in the solar system, so he could have made predictions about any new planet or asteroid that might be discovered. But he did not have a causal mechanism.
Causality is closely connected with counterfactual analysis. If an event A is followed by an event B, we only say that A caused B if counterfactuals for A would have been followed by something other than B. If rain follows my rain dance, I only argue that the dance caused the rain if I have a convincing argument that it would not have rained if I had not danced. A truly causal argument would provide a connected chain of events from the dance to the rain, with every link in the chain causing the next link.
Isaac Newton found a more powerful theory of mechanics by positing a gravitational force between any two massive objects, and saying that the force causes the orbital motion. Laplace argued in 1814 that all of nature is predictable with causal mechanics, given sufficient data.
This Newtonian causality was not true causality, because it required action-at-a-distance. One planet could exert a force on another planet over millions of miles, without any intermediate effects. A truly causal theory required the invention of the concept of field, such as electric or gravitational field, that can propagate thru empty space from one object to another. James Clerk Maxwell worked out such a theory for electric and magnetic fields in 1865, and that was the first relativistic theory.
A field is a physical way of describing certain counterfactuals. Saying that there is an electric field, at a particular point in space and time, is another way of saying what would happen if an electric charge were put at that point. The field is one of the most important concepts in all of physics, because it allows reducing the universe to the mechanics of locally defined objects. Thus physics is rooted in counterfactuals at every level. You could say that reductionism works in physics because of clever schemes for distributing counerfactual info over space and time.
A trendy topic in theoretical astrophysics is the multiverse. This involves a loose collection of unrelated ideas, but they all involve hypothetical universes outside of our observational abilities. It is a giant counterfactual exercise, with no experiment to decide who is right.
A particular fascination is the possibility of intelligent life in other universes. It appears that our universe is finely tuned for life. That is, it is hard to imagine the development of life in most of the counterfactual universes.
The most bizarre approach to counterfactuals is the many-worlds interpretation (MWI) of quantum mechanics. It simply posits that every possible counterfactual has an objective reality in an alternate universe. The extra universes do not really explain anything because they do not communicate with each other. There can be no experimental evidence for the other universes. There is no theoretical reason either, except that some physicists are unhappy with counterfactuals being just countefactuals.
The many-worlds seems like an endorsement of counterfactual thinking, but it corrupts such thinking by declaring the the counterfactuals real. A counterfactualist might argue, "if a new ice age were beginning, then we would probably notice cooler termperatures, but we don't, so we are not in a new ice age." But in many-worlds, all exceptionally improbable events take place in different universes, and we could be in one of them. Thus many-worlds leaves no good rationale for rejecting counterfactuals.