1630s, "Any rhyming verse in which the meter is forced into metronomic regularity by the stressing of normally unstressed syllables and in which rhyme is forced or banal" [Miller Williams, "Patterns of Poetry"]. Earlier as an adjective (rim doggerel, late 14c.), an epithet applied to loose, irregular verse in burlesque poetry.
Probably from pejorative suffix -rel + dog (n.), but the sense connection is not obvious. Perhaps it was applied to bad poetry with a suggestion of puppyish clumsiness, or being fit only for dogs, or from the "mean, contemptible" associations of dog in Middle English. Attested as a surname from late 13c., but the sense is not evident. Related: Doggerelist.