Consider the definition of a confounding variable is a variable that causes both treatment and outcome. In addition, we say that A is a effect modifier when the average causal effect of X on Y varies across levels of A (Hernán & Robins, 2020).
So, can a confounding variable be used as a moderating variable? Intuitively, when a variable satisfies the condition of confounding, it seems to satisfy the condition of being a moderating variable as well. But I am confused about some of these issues. As a common cause of X and Y, the confounding variable A has a causal effect on Y; at that point, if the causal effect of X on Y differs at different levels of A, then the moderating effect of A on the causal effect of X on Y becomes an interaction, and then we need to assume (conditional) exchangeability for both X and A. I am not sure if my analysis above is correct.