The name of the farmer is not stated in the song but the dog is named Bingo. "There was a farmer had a dog, / and Bingo was his name-o...".
The original intention that it is the dog and not the farmer's name is made clear in earlier versions of the song. In an earlier version of the song the dog was named "little Bingo". From the 1785 songbook "The Humming Bird":
"The farmer's dog leapt over the stile, / his name was little Bingo, / the farmer's dog leapt over the stile, / his name was little Bingo....".
In the same earlier version of the song from 1785 the second verse also states the farmer named other things besides his dog.
"The farmer loved a cup of good ale, / he called it rare good stingo, / the farmer loved a cup of good ale, / he called it rare good stingo...".
Source: https://en.wikipedia.org/wiki/Bingo_(folk_song)