So the sentence would look like this:
..., and cows, sheep, pigs, and perhaps dogs, were domesticated.
I'm not so sure I'd like the comma there because then it separates this long subject from the verb. This is almost never done in modern English (the 18th and 19th centuries used more commas), but this MIGHT work here.
I'm also wondering why you have a comma at the beginning, before and cows.
How about a comma after pigs, where it would be more usual (the serial comma)?
..., and cows, sheep, pigs, and perhaps dogs were domesticated.
It would be possible to put commas around perhaps but in this sentence I think it would break up the rhythm too much.
My vote is for just a comma after pigs.