What would the modern world look like if Anibal Barca had successfully taken over Rome?
Anibal Barca, whom Americans know as Hannibal, was the strongest foreign enemy that Rome encountered until Rome was sacked by the Visigoths in 410 CE. Hannibal was a field commander during the second war between Rome and Carthage (218-201 BCE), which were at that time two comparable City States who faced each other across the Mediterranean Sea. Carthage was located in the modern nation of Tunisia, just 200 miles from the coast of Sicily.
The two nations were both expansive powers. Carthage had a stronger navy, but Rome had already proven their equal in the first Punic war. Carthage and its allies the Berbers controlled the North Coast of Africa from Western Libya to the Straits of Gilbraltar, the southeastern quarter of Spain, and the Balearic Islands. Rome was far from the world power it became in the next 200 years. It had consolidated its power in Italy and on the islands of Sicily, Sardinia, and Corsica, but recently subjugated peoples were ready to rebel against Rome at any time. Rome had defeated Carthage in one war already, when Carthage threatened to invade Sicily and the Italian mainland.
Hannibal enters history at this critical juncture. Rome is not yet a world power. Carthage has more territory to defend, with a major power base in Spain at New Carthage. This became a liability in the later stages of the conflict. Hannibal brings an army overland from Spain and crosses the Alps during the winter of 219-218. Rome's enemies on the Italian peninsula flock to his aid.
At first Hannibal has success in convincing such people as the Gauls of the Po Valley to rebel against the Romans and join his army. He also has success in battles like Trebia and Trasimene, where large numbers of Roman soldiers and their allies are killed. He is a better tactician than anyone the Romans can put in the field. Hannibal wins a great victory at the Battle of Cannae, completely annihilating the Roman army sent to defeat him.
But--despite his victories, the Romans don't surrender. Instead, they fight back, recovering cities he invested and harassing his soldiers with Fabian tactics. Their great general, Fabius Cunctator (Fabius the delayer)
"shadowed and harassed the Carthaginian army while avoiding a major confrontation. Knowing that Hannibal was cut off from his supply lines, Fabius executed a scorched earth policy hoping to starve the invader into retreat. Moving along interior lines of communication, Fabius was able to prevent Hannibal from re-supplying, while inflicting several minor defeats."
Meanwhile, the Romans under Scipio Africanus won important victories outside Italy. By seizing New Carthage in what is now Spain, Scipio cut off Hannibal's source of funding. Eventually, Scipio landed in Africa and forced Hannibal to return to defend the homeland. The Romans routed the Carthaginians under Hannibal at the Battle of Zama in 202 BCE, ending the war and the Carthaginian threat forever.
To answer your question: Suppose Hannibal had succeeded in taking over Rome, how would that have changed history?
As the history of the war demonstrates, the Romans were defeated again and again, yet refused to surrender. Hannibal himself could have attacked Rome, but recognized that fighting the Romans on their home ground would have been suicidal. The Romans became the rulers of the world because they were tougher and meaner than their adversaries. They had honed their strategies by conquering all the tribes of Italy. Even if Hannibal had succeeded in entering Rome at the head of his victorious army, he would have found the Romans impossible to govern.
So the answer to your question is, Hannibal could not have "taken over" Rome. This is not a case where history could have been changed by a coin toss, as when Caesar defeated Pompey, or Octavian defeated Antony. The Romans would never have submitted to Carthaginian rule.