Step 1Peel the skin from the duck legs and set it aside for another use. Salt the duck legs lightly on both sides and set aside.
Step 2Choose a Dutch oven or a heavy covered pan that is just big enough to hold the duck legs in one layer. Combine the onion, garlic and olive oil in the pan over medium-low heat. Cover and cook, stirring once or twice, until the onions have thoroughly softened, but are not brown, about 10 minutes.
Step 3Lay the duck legs on top of the bed of onions and add just enough red wine to barely cover them halfway. Lay a sheet of foil directly on top of the duck and press it to the sides of the pan to create a loose seal. Cover tightly and cook over low heat until the duck meat is falling off the bone, about 1 1/4 to 1 1/2 hours. The heat should be low enough that the liquid barely bubbles. Turn the legs once or twice to make sure they cook evenly.
Step 4Remove the legs from the pan, set them aside, and increase the heat to high. Cook until the wine has reduced to just below the top of the onions, about 5 minutes. Stir in the tomato paste and continue cooking over medium-high heat, stirring occasionally, until the paste has thickened again and is a dark brick red, almost brown, 15 to 20 minutes.
Step 5Chop the canned tomatoes, drain them again and add to the pan. Cook, stirring occasionally, until the sauce is a dark red and has thickened so that rather than a quiet simmer, it makes distinct popping sounds when the cooking bubbles burst, 20 to 25 minutes. It will want to stick a little during the last 10 minutes, so stir more frequently then.
Step 6While the tomatoes are cooking, remove the duck meat from the bones and shred it into large chunks. Discard the bones. When the tomatoes are done, add the meat and the rosemary, replace the foil and close tightly with the lid. Reduce the heat to low and cook until the sauce is quite thick and the meat begins to pull apart in strings when it is stirred, about 30 minutes. Just before serving, stir in the red wine vinegar and salt to taste.