In the begining of 19th century US law (copyright act of 1790) protected only American authors.(1) There were no international copyright agreements between the US and other countries, making it nearly impossible for a foreign author to protect his work in that country.
One of the most victimized authors was Charles Dickens, whose novels were mercilessly pirated in the US, so much so that Dickens commented about the problem when lecturing in the US (in 1842) and in his writings (1),(2). The opposite was also true, i.e. American authors were also pirated in Britain.
Eventually some international agreements appeared and registry offices for the protection of intelectual property were created in the US, so theoritically a foreign author could register and have their work protected in the US. However the system was virtually ineffective and copyright violations were common, even about US owned intellectual property.
In an effort to protect their intellectual property in this legal void, sometimes companies introduced a few false details in reference works, so that if the work was copied, the original source could be traced back. This was common practice for example with maps (an extremely valuable asset in a country still in an settling phase). (3)
In performance arts, the public performance of a piece (song, stage play, musical) was (and still is, by the way) a form of ascertain one's authorship. Gilbert and Sullivan tried to use that in their favor with several strategies, without success (see Chris Sunami answer and (1) for more information)
In summary, copyright legislation was sparse and mostly uncoordinated betweeen countries until the 20th century. Note that only in 1988 did the US only adhered to the Berne convention (which exists since 1886) (4).
Copyright infrigment cases were very rare in until mid 20th century. Only 6 claims of music copyright infrigement are court filed in the US before 1900 and only about 40 in the first half of the 20th century (5). When historically we know that there were so many violations and concern from authors, that clearly shows that legal protection mechanisms were weak, discredited or both.
(1) Edward Samuels, The Illustrated Story of Copyright
(2) Charles Dickens: Struggles For Copyright Laws
(3) This wikipedia page explains the concept of "fake entries", but this video by the author John Green does it in a much funnier way.
(4) A Brief History of Copyright
(5) Music copyright infringment resource; this resource is (self admittedly) incomplete, but even so the low number of reported cases is significant.