Assuming the combinatorial interpretation or the set-theoretic interpretation of natural number exponents, $0^0$ is not undefined, because we can reason that $0^0 \equiv 1 \pmod{p}$.
Obviously, the following congruence is incorrect though. Can you please help me understand where exactly the error is?
$$\begin{align} 1 &\equiv 0^{0} \\ &\equiv 0^{p-1}\\ &\equiv 0^{1+p-2} \\ &\equiv 0^1 \cdot 0^{p-2} \\ &\equiv 0 \cdot 0 \\ &\equiv 0 \pmod{p} \end{align}$$
Edit: $p$ is an odd prime.
Misapplied modular exponent reduction below appears to be the root of the misunderstanding.
True is $\,n\equiv k \pmod{p\!-\!1}\,\ $ implies $\,\ \color{#0a0}{a^{\large n}\,\equiv\, a^{\large k}}\ \pmod{\!m}\ \ \color{#c00}{{\rm assuming}\ \ a^{\large p-1}\equiv 1\pmod{\!m}}$
because $\, n\, =\, k+j\,(p\!-\!1)\,\Rightarrow\, a^{\large n} = a^{\large k}(\color{#c00}{a^{\large p-1}})^{\large j}\equiv a^{\large k} \color{#c00}1^{\large j}\equiv a^{\large k}\pmod{\!m}$
But in your case $\,a \equiv 0\,$ so $\,\color{#c00}{a^{\large p-1}}\equiv 0^{\large p-1}\equiv \color{#c00}{0\not\equiv 1}\,$ so above does not apply
Therefore you don't need little Fermat, but you do need the $\color{#c00}{\text{ hypothesis}}$ that $\,a^{\large p-1}\equiv 1\pmod{\!m}\,$ to apply the above inference to infer that exponents on $a$ can be considered $\!\bmod p\!-\!1$.