One of the ways that oxygen enters an aquatic ecosystem is through interaction with the air. Whether it is wave action on a beach or any sort of rapid in a river, when air is naturally trapped by water, it is possible for some of the oxygen to be absorbed. Hence the need for some sort of mechanism to get bubbles into an aquarium so that the fish will be able to "breathe" since most aquariums are not large enough to generate wave action.
Another way that oxygen can enter an aquatic ecosystem is through marine plants such as phytoplankton and their natural respiration that involves the use of the sun's energy to effect photosynthesis and one of the by-products is oxygen. This is sometimes released into the water or absorbed by other animals as it travels up the food chain.