Cancellation theorem in group theory (for direct product) says that if $B$ is a finite group and $A \times B \simeq A_1 \times B_1$ and $B \simeq B_1$ then $A \simeq A_1.$
Of course, if $B$ is not finite, the result is absurd, even for finitely presented groups (Here is an example by Steve)
I wonder whether the cancellation theorem holds for different products (in finite or infinite cases), such as semi-direct product, free product, fiber product over a given group, Zappa-Szep product (knit product), Wreath product.
Of course, knit products and semidirect products are more general than direct products, so the counterexample you cited above works in both those cases as well.
– Steve D Dec 14 '11 at 08:04