The transformer primary and secondary are isolated from each other. What have you defined as the reference potential on each side? That will determine the polarity of math. You can assign both sides in any combination you want, as long as you keep the math consistent with your definitions.
Remember the transformer is just DRAWN with dots on the opposite side, but the primary and secondary are isolated in reality. That means you could flip the entire right side of the transformer in the drawing upside down so the dots are on the same side if you wanted to...you would just also have to flip the entire right side of the circuit upside down too so things stay consistent (although it doesn't matter so much with an impedance which aren't polarized). Or you could do the same thing with the left side. It doesn't matter.