Sharks' and dolphins' similarities (body shape, fin, and flippers) are analogies — traits that each lineage evolved independently.
Dolphins are mammals, and sharks are fish. ... However, both sharks and dolphins have evolved specific analogous traits — streamlined bodies, dorsal fins, pectoral fins and flippers — to achieve the same goal, which is to swim quickly through the ocean and catch prey.