Yes, that’s fine if it’s pre-arranged.
They did that in my county about 15 years ago. “Poli-Migra”. It was chaotic at first as green deputies used their new special powers and caused grief to regular working folk.
But after some tussling back and forth, they don’t use their SUPER DUPER ICE DEPUTY POWERS unless it’s somebody who did bad.
We also have a Native American police force there, distinct from the County I think – part of the Indian Reservation – and they often handle things – and they will sometimes hand people over to the County who will hand them over to ICE for processing, etc.
In the end, the pickers keep picking the tomatoes and potatoes but the bad boys are kicked out.