Do full rank matrices in $\mathbb Z^{d\times d}$ preserve integrals of functions on the torus? Let $\mathbb T:=[0,1]/(0\sim 1)$.  Its easy to see that if $f:\mathbb T\to \mathbb R$ and $k\in\mathbb Z$ is not zero, then $f_k(x):=f(kx)$ (1) defines a map $ f_k:\mathbb T\to \mathbb R$, and
$$ \int_{\mathbb T} f_k(x) dx = \int_{\mathbb T} f(x)dx$$
Indeed: identifying with 1-periodic functions on $\mathbb R$, one has
$$ \int_{\mathbb T} f_k(x) dx = \int_0^1 f_k(x) dx = \frac1k\int_0^k f(y)dy \overset{\star}= \frac1k\sum_{j=0}^{k-1}\int_0^1f(y+j)dy = \int_0^1 f(y)dy. $$
Question
Is the following $d$ dimensional analogue true?
Let $f:\mathbb T^d\to \mathbb R$ and $K\in\mathbb Z^{d\times d}$ with $\det K\neq 0$. We well-define a map $f_K:\mathbb T^d\to R$ by $f_K(x) := f(Kx)$. Is it true that
$$ \int_{\mathbb T^d} f_K(x) dx = \int_{\mathbb T^d} f(x)dx?$$
The above proof only extends to diagonal matrices $K$. The issue for me is in getting a replacement for the identity marked $\star$. For an example matrix where the above isn't enough, consider $M=\begin{pmatrix} 2 & 1 \\ -1 & 2 \end{pmatrix}$. $M$ sends $[0,1]^2$ (green) to $M[0,1]^2$ (red):

and the associated change in coordinates (corresponding to the inverse map) looks like this:

Note that $\det M=5$ and there are five small (rotated, translated) cubes in one big cube.
So I suspect the calculation should go like this. Presumably,
$$ \int_{\mathbb T^d} f(Kx)dx = |\ker K|\int_{\mathbb T^d/\ker K}f(Kx)dx\tag{A}$$
where we identify $K\in\mathbb Z^{d\times d}$ with the map $K:\mathbb T^d\to\mathbb T^d$.
Then, it seems that$$ |\ker K| = |\det K|\tag{B}$$
Since the First Isomorphism Theorem tells me that $K$ is an isomorphism from $\mathbb T^d/\ker K$ to $\mathbb T^d$, change of variables $y=Kx$ (with Jacobian  $1/|\det K|$) gives
$$\int_{\mathbb T^d/\ker K}f(Kx)dx = \frac1{|\det K|}\int_{\mathbb T^d} f(y) dy,$$
which finishes the proof.
So now the question is, how does one prove $(A),(B)$?
The appearance of $\mathbb Z^{d\times d}$ reminds me (OK, it reminded a friend) of the fundamental theorem of finitely generated abelian groups, but I have forgotten this almost completely.
It also seems from googling that a key thing im missing is the ability to identify a ‘fundamental domain’? All thoughts welcomed
 A: The short answer is: you are correct.
(My estimation is that you don't need the details, but for posterity I think it would be good to have these written.)

There are two ways of seeing this: either one can use the properties of the Haar measure, or else one can compute the integrals like you were doing. Recall that if $(X,\mu)$ is a measure space and $\phi:X\to X$ is measurable, then $\mu$ is $\phi$-invariant iff
$$\forall f\in L^1(X,\mu): \int_X f\circ \phi(x)\, d\mu(x) = \int_X f(x) \,d\mu(x),$$
or alternatively for any measurable $B\subseteq X$: $\mu(\phi^{-1}(B))=\mu(B)$. Here typically the LHS is called the pushforward of $\mu$ by $\phi$, and it's denoted by $\phi_\ast(\mu)$. I should mention that the map you define is called the Koopman operator $U_\phi$ in dynamics circles; it acts on functions by $U_\phi:f\mapsto f\circ \phi$. Under the standard pairing of functions and measures we have an adjunction
$$\langle \mu\,|\, U_\phi(f)\rangle = \langle \phi_\ast(\mu)\,|\, f\rangle.$$
Typically after having an invariant measure the spectral theory of $U_T$ lifts off (or one can modify $U_T$ with some Radon-Nikodym cocycle). I think of this matter more measure theoretically, so I'll focus on $\phi_\ast$ instead of $U_\phi$.

First Method:
For the first method, we have the following general observation:
Obs.1: Let $G$ be a compact (Hausdorff) topological group, and $\phi:G\to G$ be a continuous group endomorphism (i.e. an endomorphism of $G$ in the category of topological groups). If $\phi$ is surjective, then $\phi$ preserves (both left and right) Haar measures on $G$.
Pf: This is by the uniqueness of Haar measures. Indeed, for any $g\in G$, ${l_{\phi(g)}}_\ast (\phi_\ast(\lambda_G))=\phi_\ast(\lambda_G)$ for a general $\phi$, and if $\phi$ is surjective one can replace $l_{\phi(g)}$ with $l_g$. (Here $l_h$ is left multiplication by the element $h\in G$.) (See the discussion at Endomorphisms preserve Haar measure for more.).
Note that the $dx$ in your notation is indeed the Haar measure (in this case $\mathbb{T}^d$ is abelian, so we don't need to distinguish left and right Haar measures. Further, due to compactness we may as well assume that our measures are probability.)
Of course, one little matter is that we need to relate matrices and topological group endomorphisms of $\mathbb{T}^d$. $\mathbb{T}^d$ is more than a topological group; indeed it's a Lie group and that's how one can relate matrices and endomorphisms. Building up on my answer (https://math.stackexchange.com/a/4180086/169085) to an old question of mine we have that
$$T_\bullet: M_d(\mathbb{Z})\to \operatorname{End}_{\text{Lie}}(\mathbb{T}^d), A\mapsto ([v]\mapsto [Av])$$
is a bijection with inverse $\phi\mapsto \phi'(0)$. Here we identify $M_d(\mathbb{Z})\cong \mathbb{Z}^{d\times d}$ as a certain subset of linear maps on $\mathbb{R}^d$, and $[v]$ is the element of $\mathbb{T}^d$ that admits the vector $v\in\mathbb{R}^d$ as a representative. Also note that $T_\bullet$ is additive and multiplicative:
Obs.2: $T_{AB+C}=T_A\circ T_B+T_C$.
The aforementioned question of mine was about automorphisms of $\mathbb{T}^d$, here the focus is possibly non-invertible maps. In that regard let us make the following observations:
Obs.3: $T_A$ is surjective $\iff$ $A$ is surjective $\iff \det(A)\neq0$.
Pf: The second $\iff$ is clear. Say $A$ is surjective, fix $y\in\mathbb{T}^d$, and pick a $w\in\mathbb{R}^d$ with $[w]=y$ (taking $\mathbb{I}^d=[0,1[^d\subseteq \mathbb{R}^d$ as the fundamental domain for the quotient $\mathbb{R}^d\to \mathbb{T}^d$ one can pick such $w$ systematically by requiring $w\in\mathbb{I}^d$). Then $Av=w$ has a solution, so $x=[v]$ is a solution to $T_A(x)=y$. Conversely, if $A$ is not surjective, for some $w\in\mathbb{R}^d$, $Av=w$ has no solution $v$, whence $T_A(x)=[w]$ has no solution $x\in\mathbb{T}^d$.
Obs.4: $T_A$ is injective $\implies$ $A$ is injective (but not vice versa, like you observed).
Pf: Say $T_A$ is injective, let $Av=0$. Then $T_A([v])=[0]$, whence $v\in \mathbb{Z}^d$, that is to say $\ker(A)\leq \mathbb{Z}^d$ (as a subgroup). But also $\ker(A)$ is a linear subspace of $\mathbb{R}^d$, so it has to be trivial.
Obs.5: Since surjectivity and injectivity of linear maps of finite dimensional vector spaces are equivalent, we have

Thus we have that $\det(A)\neq0$ for a square matrix $A$ with integer entries characterizes surjectivity for endomorphisms of the torus, and Obs.1 produces the result in question. Note that for $d=1$ we recover your statement that $x\mapsto kx$ on the circle is measure preserving as long as $k\neq0$.

Second Method:
The self-answer I've mentioned earlier identifies automorphisms of $\mathbb{T}^d$ as $T_A$ with $|\det(A)|=1$. By the earlier part of this answer we have that $T_A$ is injective iff $|\det(A)|=1$. For the second method we'll need a slight generalization of this statement. You've also guessed its proof; it's sufficient to consider diagonal matrices.
Obs.6: If $T_A$ is surjective, then it is $|\det(A)|$-to-$1$.
Pf.: By Obs.3 we are guaranteed that $|\det(A)|\neq0$. First consider a diagonal matrix $D$, say $D=\operatorname{diag}(\lambda_1,\cdots,\lambda_d)\in M_d(\mathbb{Z})$. We claim that for any $y\in \mathbb{T}^d$, $T_D(x)=y$ has exactly $|\det(D)|$ solutions. Fix an anonymous $y\in\mathbb{T}^d$ and lift the equation to $\mathbb{R}^d$, so that we have $Dv=w$ with $[w]=y$. Denote by $\widetilde{y}$ the unique vector in $\mathbb{I}^d$ with $[\widetilde{y}]=y$. Then we can represent the anonymous $w$ as $w=\widetilde{y}+z$ for some anonymous $z\in\mathbb{Z}^d$, so that the equation is now $Dv=\widetilde{y}+z$. Solving it we get $v=D^{-1}(\widetilde{y})+\left(\dfrac{z_1}{\lambda_1}, \cdots, \dfrac{z_d}{\lambda_d}\right)$. Projecting any such solution down to $\mathbb{T}^d$, we have that
$$(T_D)^{-1}(y)=\left\{\left.[D^{-1}(\widetilde{y})]+\left[\left(\dfrac{z_1}{\lambda_1}, \cdots, \dfrac{z_d}{\lambda_d}\right)\right]\,\,\right|\,\, z_1,\cdots z_d\in \mathbb{Z}\right\}.$$
There is some redundancy on the RHS; getting rid of said redundancy gives a bijective description
$$(T_D)^{-1}(y)=\left\{\left.[D^{-1}(\widetilde{y})]+\left[\left(\dfrac{z_1}{\lambda_1}, \cdots, \dfrac{z_d}{\lambda_d}\right)\right]\,\,\right|\,\, z_1,\cdots z_d\in \mathbb{Z}, 0\leq z_1< |\lambda_1|,\cdots 0\leq z_d<|\lambda_d|\right\}.$$
In particular $\#\left((T_D)^{-1}(y)\right)=|\det(D)|$. So the statement is true for diagonal matrices (as you remarked).
Now take an anonymous surjective $A\in M_d(\mathbb{Z})$. By the Smith normal form theory (as in Computing the Smith Normal Form), there are $L,D,R\in M_d(\mathbb{Z})$ such that
$$A=LDR,\quad\text{and}\quad L,R\in GL(d,\mathbb{Z}).$$
By Obs.2 we have $T_A=T_L\circ T_D\circ T_R$ and by my self-answer mentioned earlier we have $T_L,T_R\in \operatorname{Aut}_{\text{Lie}}(\mathbb{T}^d)$. Let $y\in\mathbb{T}^d$. Then
$$\#\left((T_A)^{-1}(y)\right)=\#\left((T_D)^{-1}(T_L^{-1}(y))\right)=|\det(D)|=|\det(A)|.$$
(Thus we also have that any surjective $T_A$ is a self-cover of $\mathbb{T}^d$.)
Claim: $T_A$ is measure preserving iff it's surjective.
Pf: It's clear that surjectivity is necessary. Let's see that it's also sufficient. We need to show that if $B\subseteq \mathbb{T}^d$ is (Borel) measurable, then ${T_A}_\ast(\mu)(B)=\mu(B)$, $\mu$ being the Haar probability measure on $\mathbb{T}^d$. The Borel $\sigma$-algebra is generated by open balls of small radius, so it suffices to consider $B=B(x,\epsilon)$, $x\in\mathbb{T}^d$, $\epsilon\in\mathbb{R}_{>0}$, $\epsilon\ll1$.
So let $x\in \mathbb{T}^d$. By Obs.6 the preimage $(T_A)^{-1}(x)$ has exactly $|\det(A)|$ elements. Take $B=B(x,\epsilon)$ for $\epsilon$ small enough that $(T_A)^{-1}(B)$ is the disjoint union of $|\det(A)|$ many measurable subsets (if needed one can be more specific about how small $\epsilon$ needs to be, given $x$ (and (norm & conorm of) $A$, of course)); say
$$(T_A)^{-1}(B)=\biguplus_{i=1}^{|\det(A)|} B_i.$$
By the surjectivity of $T_A$, Obs.3, the fact that the Jacobian of $T_A$ at any point is $|\det(A)|\neq0$, and the Inverse Function Theorem, each restriction $\left.T_A\right|_{B_i}:B_i\twoheadrightarrow B$ is a diffeomorphism (one may need to replace $\epsilon$ with a smaller one). Then
\begin{align*}
\mu((T_A)^{-1}(B))
=\sum_{i=1}^{|\det(A)|}\mu\left(\left(\left.T_A\right|_{B_i}\right)^{-1}(B)\right)
=\sum_{i=1}^{|\det(A)|}\dfrac{1}{|\det(A)|}\mu(B)
=\mu(B).
\end{align*}
(Alternatively, interpreting the Smith normal form theory fact $A=LDR$ as saying that any matrix with integer coefficients is diagonal up to (measure preserving) automorphisms, one can prove that $T_D$ is measure preserving first (like you mentioned) and then extend it to $T_A$.)

Note that the last chain of equalities correspond to your (A), though one need to be careful about what the second instance of $dx$ means. Also, Obs.6 above corresponds to your (B).
Finally I should mention that possibly the phrase "invertible matrices in $\mathbb{Z}^{d\times d}$" (in the title) is ambiguous; see again my self-answer or the discussion at General linear group over integers.
