You are looking at infinite tensor products so we really shouldn't expect the infinite product to have finite dimension in most cases. Your second example was simply an infinite tensor product of $\mathbb Z$ with itself, which of course gets you $\mathbb Z$ right back. So I will try to answer a simplified question: how to compute the dimension of a ring in the form $R\otimes_\mathbb{Z}R'$, where the (commutative, unital) rings $R, R'$ are thought of as algebras over $\mathbb{Z}$.
This not so clear cut, because it depends on a lot more than the dimensions of $R$ and $R'$ alone. Some things to consider from algebraic geometry: there are localizations $R = S^{-1}\mathbb{Z}$ where we get a natural isomorphism of functors $R\otimes(-) \cong S^{-1}(-)$. These rings are 1-dimensional just like the integers, with one exception $\mathbb Q$, the localization away from 0, which is a field and thus 0 dimensional. If we tensor any localization of $\mathbb Z$ other than $\mathbb Q$ with a ring in the form $R' = \mathbb Z [ x_1, x_2, \dots, x_n]$ the dimension of $n+1$ is unchanged. Tensoring $\mathbb Q$ with such $R'$ makes the dimension go down to $n$.
Next up, with geometric perspective, there is another sort of localization, we should think of as restriction to a closed set (up to nilpotents) rather than localization to an open set in $\operatorname{Spec}\mathbb Z$, and that is the quotient rings $R = \mathbb{Z}/n\mathbb Z$. These are all zero dimensional except when $n \in \{-1, 0,1\}$, because $R_{red} = \mathbb Z / \operatorname{rad}(n)$ is a direct a product of finite fields, corresponding to the primes dividing $n$. When $n = \pm 1$, $R$ is the zero ring and it is convention to say it has dimension -1 (this convention we'll see is not at all important, we should just accept that the zero ring somehow exceptional.) For quotients, we have another useful natural isomorphism $R \otimes (-) \cong (-) / n(-)$.
Sometimes, a tensor product of two nonzero rings is 0. This is like localizing/restricting to the empty set. Take $R = \mathbb Z /2\mathbb Z$ and $R' = \mathbb Z[\frac{1}{2}]$. So $R$ restricts to $V(2)\subset \operatorname{Spec} \mathbb Z$ while $R'$ localizes to the complement of $V(2)$ and we get $R \otimes R' = 0$ since $V(2)$ intersect with its complement is empty. Another example take $R = \mathbb Z /n\mathbb Z$ while $R' = \mathbb Z /m\mathbb Z$ for $(n, m) = 1$. This is the case where $V(n) \cap V(m) = \emptyset$ and we get again $R \otimes R' =0$.
So a good way to begin calculating $\operatorname{dim} R \otimes R'$ is to first decide 'where' this ring lives in $\operatorname {Spec} \mathbb Z$. Define the characteristic of a ring $R$ to be $n$ such that the $n$-fold sum $1 + 1 + \dots + 1 = 0$, or if no $n$ exists, define the characteristic to be $0$. Then every ring $R$ is an algebra over the ring $\mathbb Z / n$ for $n$ the characteristic of $R$. In this case, we get an isomorphism $R = (\mathbb Z / n)\otimes_{\mathbb Z} R$. Let $R, R'$ be of characteristic $n, m$ respectively. Now we may see
\begin{align}R\otimes_{\mathbb{Z}} R' &\cong (\mathbb Z / n\otimes_{\mathbb Z} R) \otimes_{\mathbb{Z}}(\mathbb Z / m\otimes_{\mathbb Z} R')\\
&\cong (\mathbb Z / n \otimes_{\mathbb Z} \mathbb Z / m)\otimes_{\mathbb Z} (R \otimes_{\mathbb Z} R')
\end{align}
so the ring $R\otimes_{\mathbb{Z}} R'$ is an algebra over $(\mathbb Z / n \otimes_{\mathbb Z} \mathbb Z / m) \cong \mathbb{Z} / (n, m)$. However, we can't quite say that $(n, m)$ is the characteristic of $R\otimes_{\mathbb{Z}} R'$. As we saw before, $m$ might be $0$ while $R'$ is 'local' to the complement of $V(n)$, in which case $(n, m) = n$ but the characteristic of $R\otimes_{\mathbb{Z}} R'$ is $-1$, i.e. it is the zero ring. The zero ring just happens to be an algebra over every ring.
So, let's say you sort out the characteristic of $R\otimes_{\mathbb Z} R'$ to be some $n$, a positive number. It is easy to see now that
$$R\otimes_{\mathbb Z} R' \cong (R / n)\otimes_{\mathbb{Z}/ n}(R' / n).$$
At this point, we want to say something like the dimension of the product is the sum of dimensions, but we've seen this is not quite right. This is, however, the case if we assume $n$ is prime (so $\mathbb Z/ n$ is a field) and $R/n$ and $R'/n$ are finitely generated algebras over $\mathbb Z / n$ (hence finite Krull dimension), and we decide to change our convention so that the zero ring has Krull dimension $-\infty$. That way tensoring with 0 is like adding $-\infty$ which always results in $-\infty$. I'm pretty sure this is still all true for composite $n$ but the argument (which I have ommitted even for prime $n$) is even more complicated.
Ok, what about $n = 0$? This means both $R$, $R'$ are characteristic zero. We make the same considerations but for localizations now. The analogy for characteristic is locality. We'll say a ring $R$ is $S$-local for a multiplicatively closed set $S \subset \mathbb Z$ if $S$ is the largest multiplicatively closed set such that the canonical map $R \to S^{-1}R$ is an isomorphism. Take $S, S'$ such that $R,R'$ are $S, S'$-local respectively. Let $S''$ be the multiplicative closure of $S \cup S'$. Then we see
\begin{align}
R\otimes_{\mathbb Z}R' &\cong (S^{-1}\mathbb{Z} \otimes_{\mathbb{Z}} R)\otimes_{\mathbb{Z}}(S'^{-1}\mathbb{Z}\otimes_{\mathbb{Z}} R')\\
&\cong (S''^{-1} \mathbb Z)\otimes_{\mathbb Z} (R\otimes_{\mathbb Z}R').
\end{align}
This isomorphism is checked to be canonical as needed, so $R\otimes_{\mathbb Z} R'$ is $S''$-local. Then
$$R\otimes_{\mathbb Z}R' = (S''^{-1} R)\otimes_{S''^{-1}\mathbb Z} (S''^{-1} R').$$
Suppose $S''^{-1}\mathbb Z = \mathbb Q$, i.e. $S''^{-1} = \mathbb Z \setminus \{0\}$, and that $S''^{-1} R$ and $S''^{-1} R'$ are finitely generated as algebras over $\mathbb Q$. Then the dimension of $R\otimes_{\mathbb Z}R' = (S''^{-1} R)\otimes_{\mathbb Q} (S''^{-1} R')$ is the sum of the dimensions of $S''^{-1} R$ and $S''^{-1} R'$.
Suppose otherwise that the dimension of $S''^{-1}\mathbb Z$ is 1, and keep the localized rings finitely generated as algebras over $S''^{-1}\mathbb Z$. Then the dimension of $R\otimes_{\mathbb Z}R' = (S''^{-1} R)\otimes_{S''^{-1}\mathbb Z} (S''^{-1} R')$
is $$\operatorname{dim}(S''^{-1} R) + \operatorname{dim}(S''^{-1} R') - 1.$$
An interesting example is $R = R' = \mathbb{Q}(\sqrt 2)$. These are both $(\mathbb Z \setminus \{0\})$-local and therefore $S''^{-1}\mathbb Z = \mathbb Q$. So tensoring them over $\mathbb Z$ is the same as tensoring over $\mathbb Q$. Now, tensoring over a field is easy at the level of modules. $R, R'$ are clearly both 2-dimensional vector spaces over $\mathbb Q$ so $R\otimes R'$ is going to be 4 dimensional. In fact, it is isomorphic to the algebra $\mathbb{Q}[x,y]/(x^2 - 2, y^2 - 2)$, where $x = \sqrt 2\otimes 1$ and $y = 1\otimes \sqrt 2$.
Following my argument, the claim is that this is a zero dimensional ring. Indeed, it is not an integral domain as $(x-y)(x+y) = x^2 - y^2 = 2 -2 = 0$. So the zero ideal is not prime. However, there are exactly two prime ideals, and both are maximal. They are $(x -y)$ and $(x + y)$. So a maximal chain of primes has only 1 term and hence length 0.