There's a term for that - a "mondegreen".
Back in 1954, in Harper's magazine, Sylvia Wright described mishearing the last line of the first stanza from the ballad "The Bonnie Earl o' Moray", by Thomas Percy. She had heard:
Ye Highlands and ye Lowlands,
Oh, where hae ye been?
They hae slain the Earl Amurray,
And Lady Mondegreen.
While the real lines are, "They hae slain the Earl o' Moray / and laid him on the green."
There are some famous ones, like "Bad Moon Rising", by Creedence Clearwater revival, that contains the line, "There's a bad moon on the rise," which many people hear as, "There's a bathroom on the right." Eventually CCR started to occasionally perform it live with the alternate line on purpose.