Dolphins can enter and ride boats. They ride the boat and are not just stuck in it because when two are in a boat you can´t enter it anymore. They suffocate when they are in a boat even if the boat is swimming on water. Since aquatic mobs normally can´t ride boats it´s probably a bug.
Edit: It´s the same with Guardians
How to reproduce
1. Find a body of water
2. Spawn a boat in the water
3. Spawn a Dolphin close to the boat
Observed behavior
The Dolphin gets in the boat.
Expected behavior
Dolphins should not be able to get into a boat due to MC-128241 being fixed.
It works with Guardians too