>>13794936That alone does not mean they're topologically the same. They're homeomorphic because one can make make a doughnut from a mug and vice versa through continuous deformations (assuming the material was maleable). I otber words without ripping or adding any extra holes.
More rigorously there exists a continuous bijection between the two spaces. The fact their binective does imply the two sets have the same cardinality, but that alone does not mean homemorphic (consider and with the standard metric topology.