There are a couple of notions in play here. The internal direct product, the external direct product, and the internal (not necessarily direct) product.
The thing you are interested in is the external direct product. It is defined as follows: Let $G$ and $H$ be groups. The external direct product of $G$ and $H$, written $G\times H$, is defined to be the group that has the cartesian product $G\times H$ as underlying set, and where the multiplication is given by $(g,h)(g',h') = (gg',hh')$. It is then clear that $|G\times H| = |G||H|$.
The internal product of subgroups is the following: Let $G$ be a group and $H$ and $K$ subgroups of $G$. Define $HK = \{hk | h\in H, k\in K\}$. This is now a subset of $G$ of order $\frac{|H||K|}{|H\cap K|}$ but it need not be a subgroup.
The internal direct product is the following: If $H$ is a group with normal subgroups $H$ and $K$ such that $|H\cap K| = 1$ and such that $HK = G$ then we say that $G$ is the internal direct product of $H$ and $K$.
The connection between the internal and external direct products is the following: If $G$ is a group which is the internal direct product of two normal subgroups $H$ and $K$, then $G$ is isomorphic to the external direct product $H\times K$ via the map $\varphi: H\times K\to G$ given by $\varphi(h,k) = hk$. Similarly, the external direct product $H\times K$ is the internal direct product of the two subgroups $\{(h,1) | h\in H\}$ and $\{(1,k) | k\in K\}$.
For the specific question, just because two groups are "the same", they can still form an external direct product as described above and then the two subgroups $\{(a,1) | a\in A\}$ and $\{(1,a) | a\in A\}$ are isomorphic but not the same, and in fact they intersect trivially.