They both mean "they", but "oni" is the masculine personal gender, and "one" not masculine-personal.
Masculine personal refers almost exclusively to "a group of people including at least one male", and not masculine-personal to anything else, including a group of women-only, trees, dogs, boxes, etc.
Would the sentence still make sense if you replaced 'tamtego' with 'tego?' I am confused on the difference of the two
Yes, it would make sense. Not only on its own, it's actually even a correct translation of this sentence.
Generally, forms of "tamten" (tamtego) translate to "that", and forms of "ten" (tego) translate to [this/that/the].
In terms of 'closeness', English uses this/that/that while Polish uses ten/ten/tamten. The middle forms overlap.