The story is set in the town of "St Petersburg", inspired by Hannibal, Missouri, where Mark Twain grew up. In the story's introduction, Twain notes:
"Most of the adventures recorded in this book really occurred; one or two were experiences of my own, the rest of those boys were schoolmates of mine. Huck Finn is drawn from life; Tom Sawyer also, but not from an individual—he is a combination of the characteristics of three boys whom I knew, and therefore belongs to the composite order of architecture."[2]
This is taken right from this site. I shall provide the source link below. Authors usually write about what they know. Twain was from the south; stories of this period in time is what he knew. I encourage you to follow the link below for more detail.