In a large resealable plastic bag, combine the onions, garlic, carrot, vinegar, lime juice, ginger, lime zest, chile, black peppercorns, cayenne, bay leaf, and salt; add the chicken and seal the bag. Refrigerate, occasionally tossing the chicken with the marinade, for at least 4 hours
Remove the chicken pieces from the bag, reserving the marinade. Set a fine mesh strainer over a large bowl and strain the marinade; reserve the solids and liquids separately.
In a large Dutch oven, heat the oil over medium-high heat. Working in batches, add the chicken pieces to the pot and cook, turning once, until golden brown on both sides, about 8 minutes per side; transfer to a plate. Add the allspice to the pot, and cook until fragrant, about 2 minutes. Add the strained marinade solids to the Dutch oven and cook, stirring occasionally, until the onions have softened, about 5 minutes. Return the chicken to the pot, then add the strained marinade liquid. Bring to a boil, then turn the heat down to maintain a simmer. Cover the pot and cook, stirring occasionally, until the chicken is tender and cooked through, about 30 minutes
Transfer the chicken pieces to a serving platter. Turn the heat back up to medium-high and cook, uncovered, until the liquid has almost completely evaporated and the onions are lightly caramelized, about 20 minutes. Season with salt and black pepper to taste, then pour the sauce over the chicken; serve warm with rice.