There is a saying in wiki of Maximal torus:
"Let $G$ be a compact, connected Lie group and let ${\displaystyle {\mathfrak {g}}}$ be the Lie algebra of G. A maximal torus in G is a maximal abelian subgroup, but the converse need not hold."
Because union of two different Abelian subgroup is not a group in general, the maximal Abelian subgroup depends on which Abelian subgroup $A'$ you start with. $A$ is maximal Abelian subgroup if you can not find a bigger Abelian group containing $A$.
My first question is : Whether all maximal Abelian subgroup of a connected Lie group $G$ has the same dimension? If $G$ is compact and connected, does the answer will change?
Because closed subspace of a compact space is compact. Every compact Abelian Lie group is isomorphic to $T^n$. So the wiki's agrument is possilbe only when a maximal abelian subgroup is not closed or not connected.
My second question is : what's the concrete example of wiki's argument?
Let's answer the second question first: Since in a Hausdorff topological group the closure of an abelian subgroup is again an abelian subgroup, a maximal abelian subgroup of a Hausdorff topological group is always closed, and in the case of Lie groups, hence an embedded Lie group. Since a connected compact abelian Lie group (of finite dimension) is a torus, a maximal abelian subgroup that is not a maximal torus must be disconnected.
Take $G = SO_3(\mathbb{R})$. This is a compact connected Lie Group of dimension $3$, and its maximal tori are embedded copies of $SO_2(\mathbb{R})$. In $G$, the two matrices
$$A = \begin{pmatrix} - 1& 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\qquad\text{and}\qquad B =\begin{pmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{pmatrix}$$
generate a Klein $4$-group $K = \{ I, A, B, AB\}$. This is a maximal abelian subgroup of $SO_3(\mathbb{R})$ which is not a maximal torus.
For a $3\times 3$-matrix commutes with $A$ and with $B$ if and only if it is diagonal, and the diagonal matrices in $SO_3(\mathbb{R})$ are precisely $I, A, B, AB$, thus there is no abelian subgroup of $SO_3(\mathbb{R})$ properly containing $K$, i.e. $K$ is maximal abelian.
Since $K$ has dimension $0$, and maximal tori in $SO_3(\mathbb{R})$ have dimension $1$, not all maximal abelian subgroups have the same dimension. In fact, a maximal abelian subgroup which is not a maximal torus must necessarily have lower dimension than the maximal tori. The connected component of the identity in a compact abelian subgroup is a torus, and if it had the same dimension as maximal tori, it would also be a maximal torus.