I'm trying to understand the notation $p \equiv q \pmod a$. Does does it implies that $p \bmod a = q \bmod a$? for example:
$$ \begin{align} 5 \bmod 7 &= 5 \\ 12 \bmod 7 &= 5 \end{align} $$
Therefor $5 \equiv 12 \pmod 7$.
The last makes more seance to me and looks true so far but I'm not sure if it's always true.
Yes, you're entirely correct. The implication is bidirectional: $$p \equiv q \pmod a \iff p \bmod a = q \bmod a.$$