From Kingdom Hearts Wiki: A world of information not accessible by Gummiship
The dolphin is found in Atlantica in Kingdom Hearts and Kingdom Hearts II. The dolphin in the Undersea Valley will be available even if there are Heartless, but the player will be unable to ride the dolphin until the Heartless are defeated.
 Kingdom Hearts
During Sora, Donald, and Goofy's first visit to Atlantica, the dolphin swims around in several places. Flounder calls it a "giant fish." It helps the party to reach the Shipwreck, particularly when Sora does not yet have access to the Mermaid Kick ability. It also leads Sora to other places in Atlantica if he lets go of the Dolphin before reaching the Shipwreck.
 Kingdom Hearts II
In Sora, Donald, and Goofy's second visit to Atlantica, dolphins like the one who helped Sora a year ago participate in the first song, "Swim This Way". Later, several dolphins dance along to "Under the Sea" along with Sebastian and Ariel, and more dolphins take part in the performance of the final song, "A New Day is Dawning".