Dramatic irony occurs when we, as readers or an audience of a play, see a different meaning in words that the characters speak because we know what is going to happen to those characters.
So, in this case, the dramatic irony comes from the fact that we know that Macbeth is plotting to kill King Duncan. Duncan, not knowing he is going to die this night in this castle, is talking about what a pleasant castle it is. To him, he's just making small talk. To us, it is ironic because we know that he is going to die inside this pleasant castle.
In Shakespeare's Macbeth, Act I, Scene 6, King Duncan and Banquo first of all have to reveal to the audience where they are and where the scene will take place. Since plays were performed without sets in Shakespeare's time, before the opening of the scene does anything else it must establish that the king's party has arrived at Macbeth's castle.
As usual, though, Shakespeare accomplishes more than one purpose with the opening of the scene. While the two are letting the audience know that they are at Macbeth's castle, they comment on the quality of the air. The king begins:
This castle hath a pleasant seat [site],
The air nimbly and sweetly recommends itself
Unto our gentle senses.
The castle is pleasant, and the air is light and sweet to their gentle senses. Banquo continues the conversation by saying that in his experience he has noticed that where the martlet (birds that they see) dwells the air smells "wooingly," and, "Where they must breed and haunt, I have observed,/the air is delicate."
Their first impressions of the castle on this visit, of course, couldn't be more wrong (which, as a side note, fits into the theme of illusion and reality earlier introduced by Duncan when he tells Malcolm that there is no way to tell what a man is really thinking by looking at his face). For most of the play Macbeth's castle will be metaphorically compared to hell. Words like pleasant, sweetly, gentle, wooingly, and delicate do not belong in a description of Macbeth's castle.
Because the audience already knows this (we have already seen and heard Macbeth, as well as Lady Macbeth, plotting the king's assassination), the scene is dramatically ironic. The audience knows something the characters do not. That is dramatic irony.
Thus, Shakespeare not only reveals to the audience where the scene will take place, but he has managed to get the audience more involved and given the audience a feeling of discovery and maybe even a bit of superiority.
Dramatic Irony occurs when the audience [readers] and a character or characters are privy to information which another character or characters who are present on stage at that moment are completely ignorant of.
Consequently,strictly speaking, the lines spoken by King Duncan at the beginning of Act I Sc.6,
are not an instance of Dramatic Irony because Banquo does not know of Macbeth's and his wife's evil plan to assassinate King Duncan; and because even after Duncan is murdered he only suspects - he is not certain - that there might have been foul play and that Macbeth might have murdered Duncan,
Nevertheless, the lines spoken by Duncan are grimly and intensely prophetically ironic because they foreshadow his assassination by Macbeth.