Yes, time dilation works both ways. The phenomenon of time dilation occurs due to the relative motion between observers or the presence of a gravitational field, and it affects both moving and stationary observers in different ways.
In the theory of special relativity, time dilation occurs when two observers are in relative motion to each other. Each observer sees the other's clock as running slower compared to their own. This means that from each observer's perspective, time appears to be dilated for the other.
Similarly, in the theory of general relativity, time dilation occurs in the presence of a gravitational field. Clocks located closer to a massive object, such as a planet or a black hole, run slower compared to clocks located farther away. So, an observer near the massive object will perceive time to be dilated compared to an observer in a weaker gravitational field.
It's important to note that the relative time dilation experienced by different observers is always reciprocal. If observer A sees observer B's clock running slower, then from observer B's perspective, it is observer A's clock that appears slower. The extent of the time dilation depends on the relative velocity or the strength of the gravitational field between the observers.
So, whether it's due to relative motion or gravitational fields, time dilation affects both observers involved, and the effect is symmetric from each observer's viewpoint.