Let $A,B \in \mathcal{M}_{n\times n}(\mathbb{K})$, where $\mathbb{K}$ is a field. If $m^A(t) = m^B(t) = q(t)$ is irreducible in $\mathbb{K}[t]$, does it follow that $A$ is similar to $B$?
The assumption of irreducibility should be crucial. For instance, consider the following two matrices:
$$ A=\begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0& 0 \end{pmatrix} \qquad B=\begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0& 0 \end{pmatrix}$$
Both have $m^A(t) = m^B(t) = t^2$, which is reducible in $\mathbb{Q}[t]$, and yet they are not similar.
EDIT
I would like to thank Lukas Heger for the useful suggestions in the comments that helped shape the proof and, ultimately, for the answer.
Proof. It is known that $A$ is similar to $B$ if and only if $I_{n,n}t-A$ is equivalent to $I_{n,n}t-B$ in $\mathcal{M}_{n\times n}(\mathbb{K}[t])$. We can compute Smith's canonical form of $I_{n,n}t-A$ and $I_{n,n}t-B$. If $f_1(t),\dots,f_n(t)$ are the invariant factors of $I_{n,n}t-A$, then $f_n(t)=m^A(t)$ and, since $f_i|f_{i+1}$ for all $i=1,\dots,n$, so for the irreducibility of $m^A(t)$ we have $f_i(t)=1$ for all $i=1,\dots,k$ and $f_i(t)=m^A(t)$ for all $i=k,\dots,n$, where $k$ is an integer less than $n$. The same holds for $I_{n,n}t-B$, so we denote by $g_l,\dots,g_n$ the non-costant invariant factors of $I_{n,n}t-B$, with $1\leq l\leq n$.
Since $l\deg{m^B(t)}=n=k\deg{m^A(t)}$ and $m^A(t)=m^B(t)$, we have $l=k$. Hence the characteristic matrices of $A$ and $B$ have the same Smith's canonical form. Therefore $I_{n,n}t-A$ is equivalent to $I_{n,n}t-B$ in $\mathcal{M}_{n\times n}(\mathbb{K}[t])$, so $A$ is similar to $B$.