The story
This has been said to refer to the Australian boxer Larry Foley (1849–1917), who never lost a fight. This is not likely as the earliest reference to the phrase is in a letter to the editor of the Illawarra Mercury in Wollongong, Australia in 1857. In it the correspondent "G U A" (probably Dr. George Underwood Alley, known for regularly corresponding with newspapers) writes "...we'll all live together, like Brown's cows, and be as happy as Larry."
Etymology from Wiktionary, CC BY-SA 4.0.