We have these two identities where $a>0$ real, $n$ integer and $z$ complex : \begin{align} (a^z)^n=a^{nz} \tag{1} \\ (a^n)^z=a^{nz} \tag{2} \end{align}
$(1)$ is true. Is $(2)$ also true?
Assuming that $(2)$ is true, consider for $a,b>0$ real, $n,m$ integer and $z_1,z_2$ complex, and the steps below must be in this order:
\begin{align} & a^n = b^m \\ & (a^n)^{z_1} = (b^m)^{z_2}\\ & a^{nz_1} = a^{mz_2} \tag{3} \end{align}
What will happen if we take the natural $\log$ of the last equation above? Since $z_1, z_2$ are complex, the properties of $\log$ are now different.
--------------------------------------------------------------------------------------------------------------------
I saw in this [post][1] the following formula, for some integer $k$: \begin{align} \log_{b_1}({a_1}^d) = \dfrac{d \ln(a_1) + 2 \pi i k}{\ln(b_1)} \end{align}
and tried to apply on $(3)$ considering $b_1=e$, the natural $\log$:
\begin{align} &a^{nz_1} = b^{mz_2}\\ &\ln a^{nz_1} = \ln b^{mz_2} \\ & nz_1 \ln a + 2i \pi k= mz_2 \ln b. \tag{4} \end{align}
But I got some weird results working with the above, so something is wrong. I highlighted the questions.

I agree that my answer is complicated, but that is because the subject is complicated and even seemingly innocuous expressions like $1^z$ are actually complicated since while we generally and implicitly take $1^z=1$, so constant, it is legitimate to take $1^z=\exp({2\pi iz})$ too and the last is a completely different object, an entire integral function.
So coming to your question about 4:
Line 1: $a^{nz_1}=b^{mz_2}$ - I do not know what each side means for you, since I do not know what you mean by $a^{nz}$ - see above even for $a=1$; if it means the canonical interpretation, $a^{nz}=exp(n\log a z)$, where $exp, \log$ are given unambiguously by the power series mentioned in my answer, the line is correct; also the line can be correct in other circumstances, but it can also be incorrect with differe3nt choices for each side
Line 2: Only as sets in general so the set {$\ln (a^{nz_1}$} equal to the set {$\ln b^{mz_2}$}, not necessarily as individual values
Line 3: same as line 2, as sets only not as individual values, so RHS should be understood as a set too