Actually, the term comes from an old Scandinavian word, 'skatt' which means 'tax'. In England, the word became 'scot', and referred to a specific type of tax: a municipal tax which was first levied in the 12th century. The scot was paid by villagers or townspeople on their land, the amount of the tax depending upon the size of their property.
Some people, however, were exempt from the tax, if their land was poorly located... for instance, with no water access, or in a low lying area prone to flooding. Not being required to pay the tax was referred to as being "scot free". Incidentally, while in England I visited Bath and bought lunch on the Pulteney Bridge which spans the Avon River and has shops all along it. I was told that one of the attractions of building shops on a bridge was that they weren't subject to the scot, since they weren't technically on land.
Eventually, of course, the term gradually evolved into the idiom we know today, meaning to escape punishment or consequences. The earliest written example of this which we know of is found in Robert Green's 1588 Pandosoto or Dotastus and Fawnia:
"These and the like considerations something daunted Pandosoto his courage, so that he was content rather to put up a manifest injury with peace, than hunt after revenge, dishonour and loss, determining since Egistus had escaped scot-free, that Bellaria should pay for all at an unreasonable price."
Another example is found in Samuel Richardson's 1740 novel, Pamela: "She should not, for all the Trouble she has cost you, go away scot-free."
So that's where we get the idiom 'to get away scot-free', and it has nothing to do with Scots getting away without paying for anything.