How are the characters of Macbeth in Shakespeare's Macbeth, and Victor Frankenstein in Mary Shelley's Frankenstein the same?
Victor Frankenstein, the "mad scientist" bent on creating human life from inanimate body parts, and Macbeth, the warrior thane who murders his way to the throne, both suffer, as mentioned in the other answer, from an excess of ambition.
This overwhelming ambition impels both of them to violate God's laws to achieve their ends. Macbeth engages in the ultimate murder taboo by killing a king, God's anointed leader. Frankenstein usurps God's prerogative to create human life. He treads where humans should not go.
Both men's violations lead to horror and disaster. Macbeth ends up, as he predicted, in a sea of blood. Increasingly suspicious, he kills everyone around him who he perceives as a threat. He also loses his wife to suicide. Victor, horrified at his hideous monster of a creation, rejects it. The creature, unloved by any human and angered when Victor makes him a bride and then destroys it, sets out on a path of vengeance.
Both men initally thought there would be a price to pay for pursuing their ambitions: Macbeth intuits that the bloodshed will not stop with Duncan, and Victor is willing to ruin his health and spend night and day in his lab to build his life form. However, neither man has any idea how high a price they will have to pay. They do not get the rewards they anticipated from their labors. Each ends up deeply disillusioned as well as ruined.
In comparing Macbeth and Victor Frankenstein, it is apparent that both men suffer from what Macbeth calls his "vaulting ambition"—
...excessive in ambition or presumption
When Macbeth ponders the reasons he has to kill and not to kill Duncan, in Shakespeare's Macbeth, he finds there are more reasons not to kill the Duncan than to do so. Duncan is the King, and killing him is a mortal sin; Macbeth and Duncan are related; the King is supposed to be protected by the almost universal law of hospitality (when any guest, friend or foe, is guaranteed safety by his host); and, Macbeth is more than Duncan's subject: they are friends. Macbeth really loves Duncan and the King has been especially good to him of late (after Macbeth has fought so valiantly for Scotland). However, Macbeth recognizes that his need for power—his ambition to be King—overshadows all else:
I have no spur
To prick the sides of my intent, but only
Vaulting ambition, which o'erleaps itself,
And falls on th'other... (I.vii.25-28)
In Mary Shelley's horror classic, Frankenstein, Victor Frankenstein is also overly ambitious. While he searches to discover the secret of reanimating dead flesh—creating life—Victor is excessively irresponsible in never considering the ramifications of his actions. He creates a being and then rejects it because the creature is horrific to look at, and Victor is overcome with second thoughts; but in abandoning his creation, Victor allows the being he has given life to roam the countryside and to find his own way, as innocent as a child, with face and physical stature that terrifies everyone he meets. More than anything else, Victor's ambition pushes him to play God.
When Victor recounts his experiences and the loss of all he loves to Walton, he warns the explorer to avoid the mistakes he made by pursuing dangerous knowledge, by trying to achieve what Walton believes will make him successful in the eyes of the world—without considering the cost to those around him...a mistake Victor also made:
...learn from my miseries, and do not seek to increase your own.
Macbeth and Victor are men who are too ambitious, and it costs them everything in the end: happiness, those they love, and their lives.