These hallucinations can be seen in Chapter 11, where the interior of Dimmesdale's heart is exposed to us, as suggested by the title. The hallucinations that Dimmesdale experiences are clearly a result of his sense of guilt and his inability to acknowledge and publicly own the sin that he sees Hester Prynne suffer for each day. Note how they are described in this chapter:
Now it was a herd of diabolic shapes that grinned and mocked the pale minister, and beckoned him away with them; now a group of shining angels, who flew upward heavily, as sorrow-laden, but grew more ethereal as they rose. Now came the dead friends of his youth, and his white-bearded father, with a saintlike frown, and his mother, turning her face away as she passed by.
Note how these hallucinations pick up on the unconscious fears of Dimmesdale, and in particular how, having committed adultery, he might end up in hell (as symbolised by the "diabolic shapes") and miss out on the chance of heaven, as indicated by the angels winging their way upwards without him. There is also the real fear of public censure of those who are most dear to him, indicated by the rejection he experiences from shades of his past. These hallucinations, in short, reveal the extremely troubled interior workings of a man who is literally wracked with guilt.