Yes. The custom varies by country though.
Before the 1950’s in America, and also the UK, it was common for priests to wear the cassock while on church grounds, but change into a clerical suit when leaving.
This differs from predominately Catholic countries, where it was common for Catholic priests to wear the cassock all the time.
Clerical apparel is decided by the local bishop’s conference, and sometimes it is necessary to ditch the cassock.
In Mexico, during anti-clerical regimes, priests were forced to wear civilian clothing outside the church, or else they risked punishment or violence. This is why you see picture of the Cristo Rey martyrs who were priests wearing civilian clothing.
In more modern settings: sometimes priests are asked not to wear their cassock when visiting prisoners, because it would be very easy for a prisoner to reach through the bar and grab hold of a corner of the expansive garment, easier than it would be if the priest was wearing a clerical suit.
Likewise, sometimes cassocks are forbidden in hospitals because it would be very easy to have it contaminated if a corner were to drift into some bodily fluid, or touch some other contaminated object.
While it’s very nice to see a priest in the cassock, and it’s a wonderful reminder of our Catholic identity, sometimes it has to be laid aside so that a priest can minister more effectively.