There are simple counterexamples, e.g. $\,A,B = 2,15\,$ yield $\,3=(AB)^*\!\neq (A^*B^*)^*\!=6$.
As explained here, $\,A\to A^*\,$ is a common test for divisibility by $19.\,$ It works as a test because $\,19\mid A\iff 19\mid A^*,\,$ but $\,A^*\not\equiv A\pmod{\!19}\,$ in general. Other tests like casting out nines and elevens do reduce to congruent numbers $\,A^*\equiv A\,$ so then your equality holds, since then both sides are $\equiv AB\,$ so being $< m = $ modulus they are equal.
The reason that the $19$ test yields noncongruent numbers is that the reduction step scales by $\:\!2^n.\,$ This preserves divisibility $\,19\mid 2^n A\iff 19\mid A\,$ but it destroys congruence $\,2^n A\not\equiv A\,$ generally. But the casting out tests do no such scaling, instead reducing using the substitution $\,10^k\equiv (\pm1)^k,\,$ which always preserves congruence.