Beowulf is the ultimate Anglo-Saxon hero. According to Anglo-Saxon conventions, the epic hero must possess many different characteristics. He must be brave, courageous, a polished speaker, a leader, a warrior, and possess super-human qualities.
That being said, the Anglo-Saxon hero must also only fight battles against foes of equal or greater strength they they possess. Given that for the Anglo-Saxons, fate was the controlling factor in life. One could simply not choose when they would die; instead, they knew that fate would choose the time of their death.
In regards to Beowulf's fight with the dragon, the typical hero would still gain fame and glory--even in death. Beowulf knew that the best way for a hero to die is during a fight with an epic foe. For Beowulf, the dragon represented the epic foe. Therefore, his death would be deemed one proving, again, his heroic valor.
As Beowulf saw it, the only way to die is in battle. When speaking to Hrothgar about his impending battle with Grendel, Beowulf stated that his death may come at the hands of the monster. This was simply something the epic hero had to face. The battle with the dragon was no different. Even though Beowulf knew that he was close to death, he would rather die fighting than waiting to die.