Perhaps the best way to look at the problem is to establish the following more precise result:
For a group $G$, the following are equivalent:
(i) Every non-identity element of $G$ has order $2$.
(ii) $G$ is commutative, and there is a unique $\mathbb{Z}/2\mathbb{Z}$-vector space structure on $G$ with the group operation as addition.
I guess you probably already know how to show that if every nonidentity element has order $2$, $G$ is commutative: for all $x,y \in G$, $e = (xy)^2 = xyxy$. Multiplying on the left by $x$ and on the right by $y$ gives $xy = yx$.
Having established the commutativity, it is convenient to write the group law additively. Then there is only one possible $\mathbb{Z}/2\mathbb{Z}$-vector space structure on $G$, since it remains to define a scalar multiplication and of course we need $0 \cdot x = 0, \ 1 \cdot x = x$ for all $x \in G$. But you should check that this actually works: i.e., defines an $\mathbb{Z}/2\mathbb{Z}$-vector space structure, just by checking the axioms: the key point is that for all $x \in G$, $(1+1)x = x + x = 0 = 0x$.
So now your question is equivalent to: is every $\mathbb{Z}/2\mathbb{Z}$ vector space isomorphic to a product of copies of $\mathbb{Z}/2\mathbb{Z}$? Well, the only invariant of a vector space is its dimension. It is clear that every finite-dimensional vector space is of this form. Every infinite dimensional space is isomorphic to a direct sum $\bigoplus_{i \in I} \mathbb{Z}/2\mathbb{Z}$, the distinction being that in a direct sum, every element has only finitely many nonzero entries. (In other words, the allowable linear combinations of basis elements are finite linear combinations.) Moreover, for any infinite index set $I$, the direct sum $\bigoplus_{i \in I} \mathbb{Z}/2\mathbb{Z}$ has dimension $I$ and also cardinality $I$.
Finally, it is not possible for a direct product of two element sets to have countably infinite cardinality: if $I$ is infinite, it is at least countable, and then the infinite direct product has the same cardinality of the real numbers (think of binary expansions). So the answer to your question is "yes" for direct sums, but "no" for direct products.