The Aztecs have proven that this idea is possible. Lake Texcoco flowed near the Aztec civilization. The Aztecs disposed of their waste in the lake. The human waste added nitrogen to the water. The nitrogen helped algae to grow, and then the algae performed photosynthesis.
Photosynthesis gives off oxygen, and oxygen purifies polluted water.
The Aztec's also abstracted the algae from the lake and used it for food. Certain types of algae like red and green algae are edible. Many cultures have eaten seaweed for centuries. Therefore, when humans dispose of their waste in bodies of water, they help algae grow. Then, the algae cleans the water and they can eat the algae.