I appears that this question does not have a specific story in mind, so I'll use "The Ransom of Red Chief" for examples of how O. Henry uses dialect. Dialect is the language used by people in/around/from a specific area, class, district, etc. It involves unique spellings, sounds, grammatical constructions, and even pronunciations of a particular group of people.
In literature, dialect can be a powerful characterization tool because it can highlight a geographic, educational, or social background of a character. O. Henry uses dialect this way with Bill and Sam. They claim to be intelligent and crafty men that can pull of a kidnapping scheme in order to fund their next scheme; however, the dialect provided to readers supports the idea that they believe that they are better educated and smarter than they actually are. O. Henry uses dialect to give Bill and Sam a stereotypical down south "good ol' boy" characterization.
“You’re a liar!” says Bill. “You’re afraid. You was to be burned at sunrise, and you was afraid he’d do it. And he would, too, if he could find a match. Ain’t it awful, Sam?"