**New answer:** I now have an answer for the subgroup case that the OP originally asked about. In fact, one has the following result: Let $G$ be a connected compact Lie group and let $p = (p_1,\ldots,p_m)$ be an $m$-tuple of elements of $G$. Define the set
$$
H(p) = \{ g\in G\ |\ (p_1g)(p_2g)\cdots(p_mg) = 1\}.
$$
If $H\subset H(p)$ is a connected subgroup of $G$, then $H$ is abelian. In particular, $H$ lies in a maximal torus in $G$.

I am going to give the proof in Part III below. I am leaving Parts I and II (which were part of my previous answer) in place because they contribute to the answer below in some way.

**Part I:** In the case $G=\mathrm{SU}(n)$, one can have an $H\subset H(p)$ be a maximal torus for appropriate choice of $p$, so the abelian condition is the best possible.

Just do this: Let $T^{n-1}\subset \mathrm{SU}(n)$ be the maximal torus that consists of diagonal elements, i.e., the elements in $\mathrm{SU}(n)$ that preserve the lines $L_i=\mathbb{C}e_i\subset\mathbb{C}^n$, where $e_i$ is the standard basis of $\mathbb{C}^n$. Let $Q\in\mathrm{SU}(n)$ be the matrix that satisfies $Qe_i=e_{i+1}$ for $1\le i<n$ and $Qe_n=(-1)^{n-1}e_1$. (Note that $Q^n=(-1)^{n-1}I$.) Then, for $U\in T^{n-1}$, one has the identity
$$
U\cdot {Q}UQ^{-1}\cdot {Q}^{2}UQ^{-2}\cdot\ \cdots\ \cdot {Q}^{(n-1)}UQ^{-(n-1)} = I.
$$
(Each of the conjugates in the product is a diagonal matrix with the eigenvalues of $U$ cyclically permuted, and the product of the eigenvalues of $U$ is $1$.) Conjugating this identity by $Q^{n-1}$, one obtains
$$
Q^{1-n}U(QU)^{n-1} = I
$$
for all $U\in T^{n-1}$, which is an identity of the form the OP desired (with $m=n$).

**Part II:** Here is an algebraic proof that one can't have $H=\mathrm{SU}(n)=G$: Suppose that one had
$$
P_1UP_2U\cdots P_mU = I
$$
for all $U\in \mathrm{SU}(n)$. Then, complexifying this relation, one would have
$$
P_1XP_2X\cdots P_mX = I
$$
for all $X\in \mathrm{SL}(n,\mathbb{C})$. [Put another way: The mapping $f:\mathrm{SL}(n,\mathbb{C})\to \mathrm{SL}(n,\mathbb{C})$ defined by $f(X)=P_1XP_2X\cdots P_mX$ is holomorphic, but, by hypothesis, it is constant on the totally real submanifold $\mathrm{SU}(n)\subset \mathrm{SL}(n,\mathbb{C})$, which is the fixed point set of the antiholomorphic involution $X\mapsto {}^t\bar X^{-1}$. Thus, $f$ is constant.]

Multiplying by $\lambda^m\in\mathbb{C}^\ast$, one finds
$$
P_1(\lambda X)P_2(\lambda X)\cdots P_m(\lambda X) = \lambda^m\ I
$$
for all $X\in \mathrm{SL}(n,\mathbb{C})$ and $\lambda\in\mathbb{C}^\ast$, which implies that
$$
P_1ZP_2Z\cdots P_mZ = \det(Z)^{m/n}\ I
$$
for all $n$-by-$n$ complex matrices $Z$ with nonzero determinant. Since the left hand side is a polynomial in the entries of $Z$, it follows that $m/n = k$ for some integer $k$, so
$$
P_1ZP_2Z\cdots P_mZ = \det(Z)^k\ I
$$
for all $n$-by-$n$ complex matrices $Z$, where $m=kn$. Now, choose $Z$ to be rank $1$, say, $Z=x\ {}^ty$ for $x,y\in \mathbb{C}^n$. Taking the trace of the above relation and using the fact that $\det(Z)=0$, one finds that the following product of quadratic forms must vanish identically
$$
({}^tyP_1x)\ ({}^tyP_2x)\ ({}^tyP_3x)\ \cdots ({}^tyP_mx) = 0.
$$
Since $x$ and $y$ are arbitrary, it follows that one of the factors ${}^tyP_jx$ must vanish identically. But this is clearly impossible, since each $P_j$ is invertible.

*Remark:* In fact, this proof works for any of the real forms of $\mathrm{SL}(n,\mathbb{C})$, such as $\mathrm{SL}(n,\mathbb{R})$, $\mathrm{SU}(k,n{-}k)$, or $\mathrm{SU}^\ast(n/2) = \mathrm{SL}(n/2,\mathbb{H})$, since they all have the same complexification.

**Part III:** Now, finally, the general proof that $H$ must be abelian.

First, by embedding $G$ into some $\mathrm{SU}(n)$ for some $n$ sufficiently large, I can assume that $G=\mathrm{SU}(n)$. Next, if $p=(p_1,\ldots,p_m)$ were such that $H(p)$ contained a connected nonabelian subgroup $H\subset G$, then, by replacing $H$ by its closure, I can assume that $H$ is a connected compact nonabelian Lie subgroup of $G$. In particular, it follows from the classification of compact Lie groups that $H$ contains a Lie subgroup $K$ that is isomorphic to either $\mathrm{SO}(3)$ or to $\mathrm{SU}(2)$.

Now recall that every compact simple Lie group $G$ has a closed, left-invariant *Cartan $3$-form* $\gamma_G$, whose value at the identity is $\gamma_G(x,y,z) = \kappa\bigl([x,y],z\bigr)$ for $x,y,z\in {\frak{g}}=T_eG$, where $\kappa$ is the Killing form of $\frak{g}$. This form generates the deRham cohomology group $H^3_{dR}(G)\simeq \mathbb{R}$. When $K=\mathrm{SO}(3)$ or $\mathrm{SU}(2)$, the Cartan $3$-form $\gamma_K$ is a canonical volume form, and, whenever $h:K\to G$ is a nonconstant homomorphism, one has $h^*(\gamma_G) = n_h\ \gamma_K$ for some integer $n_h>0$.

Now, consider the mapping $\mu:K\to G=\mathrm{SU}(n)$ defined by
$$
\mu(k) = (p_1k)(p_2k)\cdots(p_mk).
$$
By hypothesis, $\mu(k) = 1$ for all $k\in K$. However, it is straightforward to compute that
$$
\mu^*\bigl([\gamma_G]\bigr) = m\ n_h\ [\gamma_K]\not = 0,
$$
so it is not possible for $\mu$ to be constant.