A lot of comedy films will let actors improvise on set, as sometimes the funniest moments come out of improvisation, but ...
Bloopers have usually been funny endnotes to funny movies. They peaked in the late 1990s and early 2000s, but are seemingly fading away.
For the most part, a blooper that happens on a TV set will get cut from the episode. The crew will have a good laugh about it ...