Seashells do not really make any sound of their own. Inside they have many hard curved surfaces, which are good reflectors for sound. So any sound waves that get inside are jumbled up by all kinds of echoes. When you hold the shell up to your ear, you hear the noise of all those jumbled-up echoes. That does sound much like the noise of ocean waves beating against a shore.
If you have a seashell with a big cavity inside, try it out again at home next to your ear. Unless you get in a very, very quiet place, it will keep roaring as if it had brought some of the ocean with it.