I think this would be pretty difficult to pull off because Capybaras prefer to spend so much time in the water, and because (compared to other domesticated animals) rather picky eaters. Aside from the animals themselves, there is the fact that the part of the world they are from would be unlikely to see the rise of an indigenous urban population. The Capybara inhabits swamps and jungles, meaning that the humans most likely to come in contact with them are going to be hunter/gatherer types less interested in domestication.
But then, humans have domesticated waterfowl such as the Swan, so its not impossible. I imagine the Capybara would be a relatively easy critter to introduce into Florida, Central America, Southeast Asia and Central Africa. If I had to guess, I think the most likely type of widespread human interaction with the Capybara would involving introducing them as invasive species and trapping the surplus population for food, kind of like the introduction of hares to Australia.