Not all jokes are timeless, jokes that were told in different eras in history, with different uses of the words, and different cultures can easily get lost in translation. For someone writing historical fiction they need to make sure that the jokes that they are telling in the book are authentic, but they have to be careful which types of jokes they tell because some of those jokes will not be funny to the reader in the present period.
It takes a lot of research to do it correctly, and if you do it exactly correctly your book might be humorless, because no one who is reading it today will find the jokes are funny. Indeed it probably isn't funny to today's reader also considering all the funny things we have these days in our current era. Humor is everywhere in our society and one has to be very competitive to get a laugh these days.
Nevertheless, this is where a historical fiction novelist needs to figure out how they want to play it. Some jokes are funny now that were actually funny then, but not many. All books need humor, so it takes a little bit of work and extra research to figure out what jokes are translatable from the culture your writing in and the historical time period, to the present day.
Just the other day, I was reading a historical fiction novel, where the characters told a joke and they both had a laugh. The joke was one that we might like here today, but I am almost certain that no one in that time period would've told such a joke, it was totally out of context.
Now, I suppose someone simply reading through the novel wouldn't have noticed, but I did, and I guess I have less respect for the author now, then I once did, because I felt as if it wasn't authentic, and that this Historical Fiction writer didn't do their homework. Please consider all this.