You must be referring to the retroflex approximant of the caipira (hillbilly, countryside) accent — the paulistano (capital city) accent is usually not associated with that allophone. It is generally believed that the existence of this variant is due to an influence of either the Tupi languages (spoken by indigenous tribes which inhabited that region) or the Bantu languages (brought to Brazil by African slaves).
However, since neither group of languages has a retroflex approximant in their phonological inventories, both explanations are disputed. Rennicke (2011, link below) points out that this allophone might as well be a local innovation:
«According to Noll (in press), the retroflex r is actually a Brazilian innovation without explicit documentation for the investigation of its origin. He states that the same sound can also be found in isolated Spanish varieties
like those spoken in central Costa Rica, Guatemala, the Veracruz region of Mexico and the Spanish-based
chabacanocreole in the Philippines.»