Dungeons and Dragons is not set during any of humanity’s historical eras, and there is no reason to feel constrained by the norms of any one age. In fact, much can be gained by abandoning preconceived ethical notions and technological patterns and defining them anew when creating cultures and characters in your game.
The longsword and plate armor are staples in most D&D settings, and both were used during the later medieval period, around the 15th or 16th centuries. On the other hand, the medieval era did not have some of the advantages found in Faerun or Khorvaire (for example). Magical healing alone would have society changing effects, as would the existence of skilled arcanists who can summon a sphere of fire through force of will. The differences naturally continue. Players and dungeon masters are liberated then, from the dark ages of our history.
Just as game technology somewhat reflects, but is separate from, the technology of world history, the morals and ethics of in-game characters resemble, yet are independent from, typical behavior of any specific time. Since we have never known a time without the Geneva Convention, it can be hard to imagine what that might be like. Consider, from a historical perspective, the stories found in the Old Testament’s Book of Joshua: the Israelites of that period fought to exterminate their enemies in order to claim land promised them by God. Consider also the similar tales of brutality depicted in Homer’s Iliad and Virgil’s Aeneid. The sacking of Troy by the Greeks was brutal and complete. The life of a D&D character can be similarly brutal. Alternately, a civilization found within a D&D game might be extremely gentle, even pacifistic.
Part of the game’s fun comes with creating interesting characters who behave in interesting and occasionally surprising ways. When crafting these characters, don’t be afraid to take them out of comfortable settings and familiar ethical systems.