The second example is a splice of two sentences. It would be common punctuation error for native speakers to write this with a comma after "sons".
In fact these are two sentences. You should either put a full stop after "sons", or a semicolon.
My uncle has three sons; they all work in the same office.
Alternatively, you can link with a conjunction:
My uncle has three sons, and they all work in the same office.
Now, using "all of them" would make the second part a complete sentence.
My uncle has three sons. All of them work in the same office.
But "all of whom work..." is not complete (the word "whom" is acting as a relative pronoun) so this is not a complete sentence. You could, optionally, put a comma after "sons".
Compare one sentence with relative clause, with two sentences:
This is an apple, which has a hole.
This is an apple. It has a hole.
This is an apple, and it has a hole.