Support for Ms Rousseff has fallen to single-digit figures in recent polls.
Many voters have accused her of failing to stamp out corruption and blame her for the economy’s worst slump in 25 years.
Marchers took over Copacabana beach in Rio and also demonstrated outside congress in the capital Brasilia. Many wore the yellow shirts of the Brazilian football team, and sang the national anthem, carrying banners saying “Dilma Out”.
About 350,000 people took part in protests in Sao Paulo, police say. Another 25,000 people took part in a demonstration in the capital, Brasilia.