From the Super Mario Wiki
Roller Coasters first appear in the level "Target Terror" in Donkey Kong Country 2: Diddy's Kong Quest. Here, Diddy Kong and Dixie Kong have to jump from vehicle to vehicle as they advance through the level, which takes place on a coaster track. Roller Coasters also appear in the levels "Rickety Race" and "Haunted Hall". In "Rickety Race", the Kongs have to defeat several Roller Coaster-riding Kremlings, while in "Haunted Hall", the Kongs have to escape from levitating skeletal Kremling ghosts.
In Donkey Kong 64, Roller Coasters are only found in Donkey Kong's Minecart Race, which is located in the area Creepy Castle. In this game, they cannot be ridden. These distinct Roller Coasters carry TNT Barrels; if they hit Donkey Kong, they will explode, making Donkey Kong lose three coins.