The Cartesian product is not commutative: if $G\ne H$, $G\times H\ne H\times G$, though these groups are isomorphic. It isn’t associative, either, because $\big\langle\langle x,y\rangle,z\big\rangle\ne\big\langle x,\langle y,z\rangle\big\rangle$, though once again there’s an isomorphism between $(G\times H)\times K$ and $G\times(H\times K)$.
That aside, there’s no problem in principle with having a group $G$ whose elements are themselves groups; $G$ simply won’t be one of those elements. What you can’t do is form a group $G$ whose elements are all possible groups, any more than you can form a set of all sets.
What you can do in ZF is write down a first-order formula $\varphi(x)$ that ‘says’ that $x$ is a group, meaning an ordered pair $\langle y,z\rangle$ such that $y$ is a set and $z$ is a function from $z\times z$ to $z$ with the properties needed to make it a group operation on $y$. You can then write down formulas $\psi(x,y,z)$ that ‘say’ that $x,y$, and $z$ are groups and that $z$ is related to $x$ and $y$ in some specific fashion. I shouldn’t be at all surprised if it were possible to find such a formula for which one could prove
$\forall x,y\Big(\big(\varphi(x)\land\varphi(y)\big)\to\exists!z\psi(x,y,z)\Big)\;,$
i.e., $\psi$ defines what would be a binary operation on groups if the set of all groups existed,
$\forall u,v,w,x,y,z\left(\Big(\psi(x,y,u)\land\psi(y,z,v)\Big)\to\Big(\psi(u,z,w)\leftrightarrow\psi(x,v,w)\Big)\right)\;,$
i.e., that ‘operation’ is associative, and the rest of the group axioms. Then one could talk informally about the proper class $\bf{G}$ of groups and a proper class operation making $\bf G$ into a group.