The chief source of the story of Dido is The Aeneid, an epic poem composed by Vergil (often modernized to "Virgil") sometime between 29 and 19 BC, which followed a several decades long period of civil war that brought an end to the Roman Republic and rise of the Empire. Vergil was attempting to give his people a national epic that connected them to the Trojan War, the source of the Greek epics The Illiad and The Odyssey. This means, however, that The Aeneid is, at least in part, a propaganda piece.
What's fascinated me about this story, though, is the way that Vergil leaves Aeneas in an uncomfortable place. This is when Aeneas goes to the underworld to seek a prophecy from his deceased father, and encounter's Dido's shade. Here's the text from the MIT Classics Archive:
Not far from these Phoenician Dido stood,Somehow, that moment of turning away from Aeneas silently and returning to be with her first husband was very powerful to me, even at the naive age of 17. Granted, Dido is no longer relevant to the story Vergil is telling, but something about me has always smiled at the way that Dido has the chance to offer some olive branch to the epic hero, and does not.
Fresh from her wound, her bosom bath'd in blood;
Whom when the Trojan hero hardly knew,
Obscure in shades, and with a doubtful view,
(Doubtful as he who sees, thro' dusky night,
Or thinks he sees, the moon's uncertain light,)
With tears he first approach'd the sullen shade;
And, as his love inspir'd him, thus he said:
"Unhappy queen! then is the common breath
Of rumor true, in your reported death,
And I, alas! the cause? By Heav'n, I vow,
And all the pow'rs that rule the realms below,
Unwilling I forsook your friendly state,
Commanded by the gods, and forc'd by fate-
Those gods, that fate, whose unresisted might
Have sent me to these regions void of light,
Thro' the vast empire of eternal night.
Nor dar'd I to presume, that, press'd with grief,
My flight should urge you to this dire relief.
Stay, stay your steps, and listen to my vows:
'T is the last interview that fate allows!"
In vain he thus attempts her mind to move
With tears, and pray'rs, and late-repenting love.
Disdainfully she look'd; then turning round,
But fix'd her eyes unmov'd upon the ground,
And what he says and swears, regards no more
Than the deaf rocks, when the loud billows roar;
But whirl'd away, to shun his hateful sight,
Hid in the forest and the shades of night;
Then sought Sichaeus thro' the shady grove,
Who answer'd all her cares, and equal'd all her love.
Of course, Vergil was trying to provide a mythological foundation for the Punic Wars, and this may have just been his way of commenting on how hateful the Carthaginians were as opposed to how badly Aeneas had wronged Dido.
Justinus' Epitome of the Philippic History of Pompeius Trogus (book 18) provides a more generous view of Dido (here called Elissa) from a historical perspective. Aeneas has nothing to do with this story precisely because the Trojan War happened in the 11th or 12th century BC, and Carthage was founded sometime between the 8th and 9th centuries BC. If Aeneas ever did come sailing through Tunisia, he would have been too early to witness even the beginnings of the Tyrian colony that would grow to be one of the largest city-states in the Helenistic world.
Ovid's Heroides gives us a letter from Dido to Aeneas, but this falls well within the parameters of the Dido that Vergil gives us in The Aeneid. Subsequent writers and composers have given us their own takes on the story, but historical accuracy, and to a degree, even literary accuracy, is simply not possible.
Of course, once we have recognized what is impossible, we can start to imagine what is possible, and proceed from there using the clues we have to build a structure, and our imaginations to fill in the rest.