When you put a seashell to your ear you are not hearing the ocean, you are hearing the ambient noise coming from inside your ear and around you. The seashell captures and amplifies the noise, which resonates inside the shell and sounds like the rolling waves of the ocean. This effect is called seashell resonance.
You do not even need a seashell to recreate the seashell resonance effect. You can replicate it by using an empty cup or even cupping your hands over or next to your ears. The intensity of noise from outside the shell or cup will change the intensity of the ocean-like sound you hear from inside the shell, so doing this in a busy area will sound like a roaring, tumultuous shore even though it’s just the echoes and amplification of the noises around you. If you are set on actually hearing the ocean, put down the shell and head to the coast or pop in Endless Summer.