The ending of The Notebook is not clear on who lives or who dies. The feelings being described from Duke are from him missing Allie while he was in the hospital and from when Allie recognizes him after being away for so long. We find out earlier that Duke and Noah are the same person, because Allie has made the connection between the stories being told to her. And every time she recognizes that they are the same person, she pleads that she doesn’t want to wake up and forget again.
So the ending is very much reality and not a dream, but they are not dying together. It is Allie’s last memory of remembering him, and she is not able to forget him in the morning because she passes away. The verdict on Noah is left open because it was Allie’s wish for them to go away together, and they believed that their love was strong enough to produce miracles. In the sequel The Wedding, we fully find out that Noah did not die alongside Allie that night.