To add to the very thorough post by the previous editor, there is an allusion to Julius Caesar in Act 3, scene 2. Polonius says,
I did enact Julius Caesar. I was killed i' the' Capitol; Brutus killed me.
This allusion refers to Caesar's assassination by his friend Brutus. It is especially significant because it reminds us of Claudius' murder of King Hamlet as well as Hamlet's mission to avenge his father's death. It is also significant because Polonius is referring to his role as an actor. Acting, playing a part, is a major motif in the play. Further it foreshadows Polonius' death. In this one allusion, Shakespeare is able to tie in several themes in the play: betrayal, revenge, acting, and death.
There are many other allusions that are quite rich in the ideas they reflect. One that is particularly effective is Claudius' reference to Cain's murder of Abel:
O my offence is rank, it smells to heaven;
It hath the primal eldest curse upon't,
A brother's murder.
The "primal eldest curse" is the first murder recorded in the Christian bible. Again, Shakespeare is reminding us of the egregious nature of Claudius' sin/crime. He has not only killed a king, but he has also killed his own brother. Claudius' should expect some retribution as well. This quote serves to advance the themes of betrayal as well as revenge. It is clear to the reader that Claudius is guilty and that Hamlet's mission to seek revenge is not unfounded.
In Scene 2, there is an allusion to a Moslem god (Termagant) and to Herod, the Biblical King that beheaded John the Baptist. Hamlet is talking to the troupe of players and advising them not to overdo their acting, not to be more like Herod than Herod.
I would have such a fellow whipped for o'erdoing
Termagant. It out-Herods Herod. Pray you avoid it.
He also alludes to the Roman god, Vulcan. He is referring to his agitated, fiery state of mind since Vulcan was the god of fire
And my imaginations are as foul
As Vulcan's stithy. Give him heedful note;
There are many allusions given by the players in the play within a play in this act. These allusions are all to mythology:
Full thirty times hath Phoebus'cart gone round Neptune's salt wash and Tellus' orbed ground,(145)
And thirty dozen moons with borrowed sheen
About the world have times twelve thirties been,
Since love our hearts, and Hymen did our hands,
And to the mythical witch, Hecate:
Thou mixture rank, of midnight weeds collected,
With Hecate's ban thrice blasted, thrice infected,
Hamlet refers to Nero, who killed his mother, right before he goes to visit Gertrude in her chamber. He is hoping that he will not be tempted to kill Gertrude.
O heart, lose not thy nature; let not ever
The soul of Nero enter this firm bosom.
If you skim through the rest of this Act and look for names, you will no doubt find they are allusions, and often to mythology, which was common in Elizabethan times. Mythological characters were well-known to the Elizabethan audience and the people would have understood the meaning of these allusions.