Yes, of course. That's one of the attractions to The Beatles. Quite a few songs are meant to be silly and funny, and some of the stuff is just plain naughty--"four of fish and finger pie". Some of it is dark--Maxwell and Bungalow Bill. Even I am the Walrus is comical.
And I do love Zappa--The Best Band You Never Heard in Your Life is one of the greatest albums of the rock era--the lonesome cowboy Burt stuff is hilarious to those of us who saw that donkey Swaggart get his own. Most listeners now probably don't get the references, but even without, the lyrics are funny.
I love humor in music. What I don't like is those who take themselves and stupid macho-ism seriously. It ruins a band like Foreigner for me.