In large skillet, cook onions in butter, with the skillet covered, over medium heat for 15 minutes, stirring occasionally. Add water, ketchup, pepper flakes, and salt; cook, covered, 10 minutes, stirring.
Prepare outdoor grill with hot coals or heat gas grill. Grill hot dogs about 8 minutes, turning several times throughout cooking. Toast buns if you wish.
To serve, spoon about 1/4 cup onion mixture over each hot dog.