Data analysed by the programme showed some companies have regularly breached the conditions in their permits.
Treatment works are only allowed to put sewage into waterways after wet weather and when they are close to capacity.
The water industry says it will invest more than a billion pounds over five years to reduce discharges into rivers.
Treatment works are allowed to release sewage into rivers and streams after extreme weather, such as torrential rain, and when they are operating close to full capacity.
This protects properties from flooding and prevents sewage from backing up into streets and homes.
The untreated sewage is normally screened and passed through storage tanks before it is dumped.
Discharge permits issued by the Environment Agency specify the level of sewage each works has to treat before it can dump untreated sewage.
But Panorama's investigation found one water company was discharging sewage without a permit and evidence that another company had given the Environment Agency incorrect information about the sewage it was dumping in the river.
Recent figures published by the Environment Agency reveal untreated sewage, including human waste, wet wipes and condoms, was released into waterways for more than three million hours last year.
Panorama gathered detailed data from 10 water companies in England and Wales through environmental information requests. They were each asked for information on a handful of sewage works.
The data suggests seven of the 10 companies had treatment works that were breaching their permits by dumping sewage before they were treating the specified volumes.
One of the worst offenders was the not-for-profit company, Welsh Water. The data shows three of its treatment works were in breach of their permits.
Its Aberbaiden plant illegally dumped untreated sewage into the River Usk on 12 consecutive days in December.
The Usk is supposed to be a protected river, as it is a Site of Special Scientific Interest and a Special Area of Conservation.
Angela Jones, who swims in the river every day, was shocked by the programme's findings: "I know so many people who swim up that area, you know. It's just appalling, absolutely appalling.
"We can see clearly that they are releasing sewage into the water when they're not allowed to."
Open water swimmers, kayakers, paddlers and dog walkers have been asked to avoid contact with the water during and after sewage spills.
The Rivers Trust, an organisation which campaigns to protect rivers in England and Wales, has compiled a map of where water companies release treated sewage and overflows of untreated sewage into rivers.
It advises people not to enter the water immediately downstream of where treated sewage is released, and to avoid the overflow areas, especially after wet weather.
Panorama also discovered Welsh Water has been using a sewage overflow pipe on the River Usk that doesn't have a permit.
The company has been illegally dumping untreated sewage through the pipe, sometimes on several occasions a day.
Welsh Water told the programme it hoped to have a permit for the overflow pipe by July and it doesn't accept its sites are operating illegally.
The company said it works closely with regulators and works hard to comply with all environmental regulations.
"We continue to invest significantly in our network so that we minimise the impact of our activities on the environment. However, these solutions and processes can sometimes take many years to resolve in order to fully investigate, design solutions, and secure funding."
Additional data about an eleventh water company, Thames Water, was shared with the programme by the campaign group Windrush Against Sewage Pollution.
It showed the company's giant Mogden treatment works in south-west London has been illegally dumping billions of litres of untreated sewage.
The data revealed Mogden - which deals with waste from more than two million people in the city - breached its permit on 43 days last year.
Another Thames Water site, Stanton Harcourt in Oxfordshire, dumped sewage almost continuously for three consecutive months at the start of last year.
Thames Water said the sewage is partially treated because it is screened and settled in storage tanks.
It said a small number of its sewage works have struggled following periods of heavy rainfall and it is investing heavily to improve the sites.
"Putting untreated sewage into rivers is unacceptable to us, to our customers and to the environment, even when legally permitted," the company said. "We absolutely want to go further, invest more, and play our part in helping the environment to thrive."
Panorama also investigated the Wetherby treatment works run by Yorkshire Water.
Footage shot by local campaigner Mark Barrow shows the works dumped untreated sewage into the River Wharfe on several occasions last year.
But the programme found Yorkshire Water failed to report any of these spills to the Environment Agency.
Its annual filing showed no sewage dumping at all at Wetherby.
Yorkshire Water said: "We have not misled the Environment Agency, this is a single data anomaly within a very large set of data and we will certainly investigate what has happened here. There is a process for correcting submitted data with the Environment Agency and if it is found that there has been an unreported discharge we will report this in due course."
Wise men talk because they have something to say,
fools talk because they have to say something.