Non tutte le ciambelle escono col buco
Let's look at the main, individual words in this expression.
Ciambella: Una ciambella is often a donut or doughnut. But actually, it can refer to anything that is ring-shaped with a hole in the middle. It can be an "inner tube" you use in the pool, or a life-preserver. Un ciambellone is a large-size coffee cake, usually in the shape of a ring, with a hole in the middle. For more about turning a feminine noun like la ciambella into a big, masculine version such as il ciambellone using the ending -one, see this lesson.
Bona 'sta [buona questa] ciambella.
Good, this doughnut.
Caption 44, Un medico in famiglia Stagione 1 EP1 - Casa nuova - Part 10Play Caption
Escono: This is the third person plural of the verb uscire (to exit, to come/go out). In this case, we are talking about a donut or ring-shaped cake coming out of the oven or deep-frier. Sometimes there's a mistake, and one might not have its hole in the middle, it might be lopsided.
Buco: Un buco is a hole. Just like in the middle of a donut.
Cominciamo a piantarne uno. Allora bisogna fare un buco.
Let's start planting one. So we need to make a hole.
Captions 46-47, Gatto Mirò EP 10 Piantiamo un alberoPlay Caption
A word about the other words:
Non is a negating word, like "not."
Tutte means "all." In this case, it refers to the plural feminine noun, le ciambelle, so it has a plural feminine ending.
We have the conjunction col. This is a combination of con (with) and il (the).
A variation on this expression is: Non tutte le ciambelle riescono col buco.
The verb changes from uscire to riuscire. While riuscire can mean "to come/go out again," as in when you come home but have to go out again because you forgot to buy milk, it also means "to succeed," "to turn out," "to manage to do something."
Però, non tutti riescono a farlo bene.
However, not everyone succeeds in doing it well.
Caption 10, Anna e Marika Il panePlay Caption
So the meaning of the two variants is essentially the same, but with escono, we can visualize the donut coming out of the oven, and with riescono, we can visualize how they turn out.
Yet another variation is: Non tutte le ciambelle vengono col buco. Here the verb is venire (to come). "Not all donuts come with holes." The concept doesn't change.
Literally, the sentence means: "Not all donuts come out [of the oven] with holes." The figurative meaning of the expression is that not everything goes according to plan. Sometimes things turn out imperfectly, but it's not a huge deal. A nuance is that the donut will still taste good even if it is a bit misshapen or lopsided.
When you or someone else does a job that didn't come out perfectly, it's also a way of minimizing the error, as if to say, "Oh well..."