In its simplest form, irony is a difference between what appears to be and what really is. More specifically, dramatic irony occurs when audiences know something that a character does not.
In the case of Shakespeare's Macbeth, audiences are aware, toward the end of Act 1, that Macbeth has been made the Thane of Cawdor by King Duncan and that both Macbeth and his wife, Lady Macbeth, are power-hungry. Driven by the witches' prophecy, the two plot to kill the King so that Macbeth may assume that title.
When Duncan arrives at Macbeth's castle in Act 1, scene 6, he observes,
This castle hath a pleasant seat; the air
Nimbly and sweetly recommends itself
Unto our gentle senses (1-3).
In these lines, Duncan comments on the castle's fresh air and general pleasant atmosphere. Obviously, readers understand that as Macbeth is plotting to kill Duncan, the castle will certainly not be a pleasant place for Duncan.
As stated previously, dramatic irony is when the audience is aware and understands something that the character (who needs to know) does not. In the circumstance of Macbeth, the audience is completely aware that Lady Macbeth and Macbeth are plotting to, and will be successful at, murdering King Duncan. King Duncan, on the other hand, holds Lady Macbeth and Macbeth is an esteemed regard, which makes the entire circumstance dramatic and ironic -- he needs to be the one to know not to trust them, yet it is the audience that knows, and we cannot help him.
An example of this is when King Duncan states (Act I, scene vi):
See, see, our honor'd hostess! The love that follows us sometime is our trouble, Which still we thank as love. Herein I teach you How you shall bid God ’ild us for your pains,(15) And thank us for your trouble.
First, he calls Lady Macbeth his "honored hostess," however a hostess should never intend to murder her guests! Secondly, he discusses that he will bid God to thank her for her pains; this is especially dramatic because he will be meeting God through pain.
Dramatic irony is when a character says something that the audience understands to have a larger meaning that the one that the character intended.
In Act I, Scene ii, Duncan hears report of the death of the Thane of Cawdor, one of the nobles who has challenged him in what could be considered an act of treason. Duncan decides to reward Macbeth with the vacant title Thane of Cawdor. Duncan says:
No more that thane of Cawdor shall deceive
Our bosom interest. Go pronounce his present death
And with his former title great Macbeth.
The irony here is that Duncan says he'll no more be deceived by the Thane of Cawdor, but, once given this dubious title, Macbeth will deceive him by murdering him under his own roof.