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?"
The use of dialect for characterization and for comic effect was very popular in America for many years. It was also a standard routine among stand-up comedians in vaudeville. Dialect was probably popular with American readers and audiences because there was such an enormous influx of immigrants in the nineteenth and early twentieth century, and this influx must have been caused by the introduction of steamships and cheap, relatively safe transportation from the Old World. The most common dialects mimicked by writers and comedians were German, Swedish, Jewish, and Irish. The use of such dialects in fiction has a tendency to date a story or novel--i.e., to make it seem olf-fashioned. Readers do not appreciate it any more because it makes hard reading, because it doesn't seem very funny, and because it smacks of prejudice. O. Henry uses dialect frequently in his stories, and he is pretty good at it, although it does tend to make his stories sound old-fashioned. Reading O. Henry often seems like traveling back into America's past.