I’ve heard arguments for yes and no in answer to this question.
Some view humor in a sermon as being blasphemous, out of place, and irreverent. I understand the point and think it has merit. We are dealing with Big Serious Issues.
Others say humor is fine; it’s part of effective communication and keeps people listening. I get this too. Big Serious Issues can get Big and Boring. What good is it if everyone is asleep while you’re seriously discussing Big Serious Issues?
Ignoring all church tradition and sanctimony, my answer to the question is this: It depends. I’d need to ask some questions to understand the context better to give a correct answer.
1. Is the pastor funny?
If you are not naturally funny, then don’t use humor. We are often not the best judges of our own humor. The best test is if anyone thinks you’re funny when you try to be funny. If you are not funny; do not force humor into your sermons. It will sound stilted and won’t work. Don’t be the guy who reads jokes you found on the internet because you know you need laughs, but then read them all wrong with terrible timing and voice so everyone just cringes. Don’t be that guy. If you are naturally funny, I do think it is fine to be funny.