It has been purported that we know of less than 1 percent of the animals that roamed this lovely, blue planet from 65 to 250 million years ago. Whether or not dinosaurs could swim seems to be impossible to prove, insofar that dinosaurs were, quite literally, large, terrible lizards. And lizards are and always have been very adept in the waters, either swimming or skipping along the surface. However, the humongous size of these terrible lizards may have made them inadequate as swimmers, but quite capable of walking through 20 to 60 foot deep waters.
Quite possibly there were some dinosaurs that could swim across the bay to escape a predator, but there were no dinosaurs that were aquatic in nature. The Ichthyosaurs, Mosasaurs, Nothosaurs and Plesiosaurs were all water-borne aquatic reptiles, and extremely large compared to even the largest known mammals on the planet, the Blue Whales. However, these commonly misinterpreted giant marine mammals resembled fish or dolphins, and were well known for dominating the seas, sort of like the way the great white sharks did, before shark hunting became fashionable for mankind in the past 200 years and decimated them.
Of course, not all animals that lived on the planet Earth during the Triassic, Jurassic and Cretaceous eras, roughly 255 to 65 million years ago, were dinosaurs, or, more scientifically correct, were classified as dinosaurs, or have yet to be found and classified.
There may just be thousands of different dinosaurs that swam the oceans wide, as there was just one super continent at the time, Pagea, with maybe a few big islands, and a bunch of small islands, and the one gigantic Ocean. Scientists speculate that at least 95% of all animal life was wiped out after the extinction event that cleared the way for mankind to slither out of the primordial ooze.
The way that mankind found out about dinosaurs was by finding their bones, skin, teeth, dung and other bodily parts either just laying around or buried deep within the sand or rock. Fossilised footprints (paw prints?), nests and other proofs of how they lived have given light to where and how dinosaurs lived and interacted with each other. Many dinosaurs had webbed feet, giving evidence that they were proficient swimmers, yet lived on land.
Now, for mankind to find aquatic dinosaurs, or, more specifically, animals that meet the criteria for dinosaur (specifically large, lizard-like creatures. The word dinosaur comes from the Latin deinos' for terrible, and sauros' for lizard.), intact specimens would have to be found amongst sedimentary rock that either is, or used to be, at the bottom of a lake, sea or ocean. Just because a dinosaur had webbed feet is not proof that they swam, they did have evolutionary problems, after all. The largest dinosaurs were vegetarian and the smallest dinosaurs were meat eaters, making for a mixed-up, 200 million-year-long evolutionary progression.
The larger dinosaurs, mainly the plant-eating behemoths, known as Sauropods, that grew to well over 100 feet long and weighed tonnes were probably not customers at the beach hut, but they probably walked into the water to cool off, refresh with a soothing bath and moisturize that scaly, dry skin. With the lack of pollution blacking out the Sun's rays, the dinosaur's skin was bombarded with lots of that bad, cancerous, life-giving and sustaining light, and had to go for swims to soothe their sunburns, with Oil of Olay not yet invented.
Could dinosaurs swim? Not that we know about yet. As more water bodies dry up, who knows what may present itself to us after a few million years of peaceful rest.