The product is actually an operation (that is, a function from $(G/H)\times (G/H)$ to $G/H$) if and only if $H$ is normal.
This is closely related to an old answer of mine. That one shows, among other things, that if you want to define the multiplication of cosets as $(aH)(bH) = (ab)H$, then this is well-defined if and only if $H$ is normal.
Basically, if $H$ is not normal, then not every set-theoretic product of left cosets is a left coset. So $*$ is not actually an operation on the set $G/H$ of left cosets. A similar argument holds for the set of right cosets.
Indeed, suppose $H$ is not normal. Then there exists $a\in G$ such that $aHa^{-1}\neq H$. In particular, there exists $h\in H$ such that $aha^{-1}\notin H$.
Now consider the product of $aH$ and $a^{-1}H$. The element $aha^{-1}e\in (aH)(a^{-1}H)$. As it does not lie in $H$, that means that if this product is to be a left coset of $H$, then it must be the left coset $aha^{-1}H$. That is, we must have $(aH)(a^{-1}H) = aha^{-1}H$.
On the other hand, the element $aea^{-1}e = e$ lies in $(aH)(a^{-1}H)$. Thus, $e$ must lie in $(aH)(a^{-1}H)$. However, the only left coset of $H$ that includes $e$ is $H$ itself. Thus, we must have $(aH)(a^{-1}H) = eH$. But this requires $aha^{-1}H = eH$, which in turn requires $aha^{-1}\in H$ . . . which is not true by assumption.
Thus, $(aH)(a^{-1}H)$ cannot be a left coset of $H$, proving that this product is not an operation on $G/H$ when $H$ is not normal.
Do take a look at that other answer for a pretty extensive discussion of this and related topics.
Let’s dig a bit more conceptually here about what is happening when you multiply cosets.
Lemma. Let $G$ be a group, $H$ a subgroup of $G$, and $a\in G$. If $(aH)(a^{-1}H)$ is a left coset of $H$, then it is $H$; similarly, if $(a^{-1}H)(aH)$ is a left coset of $H$, then it is $H$; and if both hold, then $a\in N_G(H)$. Conversely, if $a\in N_G(H)$, then $(aH)(a^{-1}H) =(a^{-1}H)(aH)= H$.
Proof. If $a\in N_G(H)$, then $aHa^{-1}=H$. Therefore, $(aH)(a^{-1}H) = (aHa^{-1})H = HH = H$; and since $N_G(H)$ is a subgroup, $a^{-1}\in N_G(H)$ and the same argument proves that $(a^{-1}H)(aH) = H$.
Conversely, assume that $(aH)(a^{-1}H)$ is a left coset of $H$. Since $aea^{-1}e = e\in (aH)(a^{-1}H)$, this coset must be equal to $H$. Thus, $(aH)(a^{-1}H) = H$. Therefore, for each $h\in H$ we have $aha^{-1} = aha^{-1}e \in aHa^{-1}H = H$, so $aHa^{-1}\subseteq H$. The same argument, mutatis mutandis, shows that if $(a^{-1}H)(aH)$ is a left coset, then it is $H$.
Now, if $(aH)(a^{-1}H) = H$, then for each $h\in H$ we have $aha^{-1} = aha^{-1}e \in (aH)(a^{-1}H) = H$. Thus, $aHa^{-1}\subseteq H$. Symmetrically, $(a^{-1}H)(aH) = H$ implies $a^{-1}Ha\subseteq H$, and multiplying on the left by $a$ and on the right by $a^{-1}$ we get $H\subseteq aHa^{-1}$, giving equality, so $a\in N_G(H)$. $\Box$
In particular, if $H$ is such that the product of two left cosets is always a left coset, then in particular for all $g\in G$ we have that $(gH)(g^{-1}H)$ is a left coset and $(g^{-1}H)(gH)$ is a left coset, and thus that $g\in N_G(H)$. Thus, $G\subseteq N_G(H)$, hence $H\triangleleft G$.
(Comment: I would like to weaken the hypothesis that both $(aH)(a^{-1}H)$ and $(a^{-1}H)(aH)$ are cosets to just one of them, but I’m not sure right now how to do it. The argument certainly shows that if $(aH)(a^{-1}H)$ is a coset, then it is $H$ and $aHa^{-1}\subseteq H$. Ideally of course, we should be able to say something about when the product $(aH)(bH)$ is a left coset, in terms of $a$, $b$, and the normalizer, but I haven’t fully worked that out yet . . . )
Note that of course one can define other operations on the set $G/H$ that have nothing to do with the multiplication of $G$ to make the set $G/H$ into a group. In greatest generality, the fact that any set can be made into a group is equivalent to the Axiom of Choice. But if you want the operation on $G/H$ to be somehow “induced” by the operation in $G$, you are pretty much forced into normal subgroups and the standard operation on the quotient.