Its a phenomenon that had to have occurred back then. People hundreds, even thousands, of years ago still wore clothes. I can only imagine the static that would have been generated by wearing heavy fur coats. So its not unlikely that people would have experienced static shock, maybe even seen a little spark. What explanations were given for that phenomenon in a time before we understood electricity?
Thus far there has been no completely comprehensive answer to this question, in part because there were many ancient peoples who changed greatly across an immense time period. However, you might be interested in some previous answers from the FAQ section entitled "Ancients' views on static electricity":