Given how much time goes into planning, writing, and shooting a TV show, you might think that everything we see on screen is completely intentional. And when the series in question are playing to millions and millions of people, the creators would no doubt prefer that to be the case too.
However, while for the most part TV shows, much like movies, run to script, there have been some great instances when things didn't quite go as planned. No one catches a mistake and it slips through, or there isn't the time or budget to fix things. We've seen crew members appearing in TV shows because of aspect ratio changes, messy CGI, and extras doing all kinds of weird sh*t, but generally these are only discovered when the end product makes it to air.
Somtimes, though, a show goes off-script and it IS noticed ahead of time, but is left in intentionally. Other times, what might look like a mistake was very much deliberate all along. It could be that it's a stroke of genius on the part of the actor, or perhaps just a stroke of dumb luck that what happened worked so well it could be used, but all of these 'mistakes' were very much left in by design.