Here is a discussion only assuming that $R$ is Cohen-Macaulay. Let $G$ denote the GrothendickGrothendieck group of all finitely generated $R$-modules.
Fix a regular element $a$ and consider the function $$f(M) = \dim_k Tor_0(M,R/aR)- \dim_k Tor_1(M,R/aR)= \dim_k M/aM - \dim_k (0:_Ma)$$
For torsion-free module (or just Cohen-Macaulay) $M$, note that $f(M) = \dim_k M/aM$. Also, note that $f(N)=0$ if $N$ is torsion. So, for example, $f(m)=f(R)$ if $m$ is a maximal prime.
Thus $f$ induces a group homomorphism $\bar G \to \mathbb Z$, where $\bar G$ is $G/H$ where $H$ is the subgroup generated by torsion modules. Note that $\bar G$ is generated as an abelian group by the classes of $[R/P]$, where $P$ is a minimal prime.
So, we have $f(M) = \mu f(R)$ if $[M]=\mu [R]$ in $\bar G$. This happens always if $R$ is a domain an $\mu$ is rank. In general one needs to understand $\bar G$ and $f(P)$ when $P$ is a minimal prime.
To be more precise, if $R$ is reduced, then $[R] = \sum_1^s [R/P_i]$ and $[M]= \sum a_i[R/P_i]$ in $\bar G$, where $P_i$ are minimal primes of $R$ and $a_i$ is the rank of $M_{P_i}$. So if we let $\mu= \min\{a_i\}$ or $\mu = \max\{a_i\}$ we get inequalities in either direction. If it happens that $f(P_i)$ is a constant then $\mu = \sum a_i/s$ works for equality, generalizing the domain case.
Let me end with a concrete example of a non-integral, non-local ring. Let $R=k[x,y]/(xy)$ and $a=x-y$. Then the minimal primes are $P_1=(x), P_2=(y)$. We have $f(R/P_i)=1$ for each $i$ and $f(R)=2$. Thus if we define $\mu(M)=\frac{a_1+a_2}{2}$ where $a_i = rank_{R_{P_i}} M_{P_i}$, we always have $f(M)= \mu(M)f(R)$. Such equality even works for generic a, but does not work for all $a$, for instance if $a=x-y^2$.