This phrase doesn’t rely on metaphors – it states it’s wisdom outright. A thread on a Quora forum offers further references:
Oxford University Press (2008) is this quote from The Court and Character of King James by Anthony Weldon (1650), page 52:
The Italians having a Proverb, He that deceives me Once, it’s his Fault; but Twice it is my fault.
History for Colonial Williamsburg offers this American citation:
Axioms—read in the Bible, quoted from classical literature, and handed down through families—were a part of everyday life in 1700s America… In 1778, the Pennsylvania Gazette reported: “He who lives in a glass house, says the Spanish proverb, should never begin throwing stones.” A 1786 essay refers to an early, non-English form of the familiar saying “Fool me once, shame on you; fool me twice, shame on me.” Wrote George Horne, an English divine: “When a man deceives me once, says the Italian proverb, it is his fault; when twice, it is mine.”
Inspirationalstories lists a Chinese version: Once bitten by an adder, you will never walk through the high grass again.
I suppose people all over the world often discover the same wisdom.