A recent panel I was on talked about Messing With History. That is a wide topic covering a menagerie of sins.
For example, if you are writing historical fiction, get the details right. Know that the king in his castle does not have a flush toilet. He hangs over a hole leading directly to the outside of the castle wall. I don’t know how you would work that into your story, but the moral is, don’t have him pull a chain.
One of the reasons I write fantasy is so I don’t have to do a lot of research on historical details. But at the same time, I’m familiar with a broad range of history (I just don’t remember the picky details) so I can use that knowledge in my world building. When you are world building try to be original. Don’t simply scoop up ancient Egypt, or some other exotic locale, change the name, and voila! (Unless you are Guy Gavriel Kay and do it very well) You can, however, take history and re-write it as a What-If, (mine is coming out soon) or as inspiration for a plot brainstorm to start a story.
My fantasy novel, The Dark Lady, owes some (a wee bit) of the basic idea to the life of young Elizabeth the First. My second fantasy novel, The Queen’s Pawn, started with muses about the fall of Troy. I recently read a history of what happened after the death of Alexander the Great and thought there were a number of wild characters in that that would make for fantastic (as in almost unbelievable) stories, that I will never have time to use. Last month I saw a headline about a discovery in the Mediterranean Sea of a tsunami that may have wiped out an entire civilization in pre-history. Think of the ideas you could run with there!
The bottom line is, if you are writing a historical, do your research. If you are world building, it’s okay to use history for inspiration, just be original, eh?
The Queen's Pawn : Volume 1 available,
Volume 2 in editing
Volume 3 is 3/4 written
The Housetrap Chronicles: Volumes 1 to 6 available
Volume 7 in editing
Alex in Wanderland: available
Knights' Bridge: available