no they can not legally do that with out a search warrant because it would have been taken illegally which would mean that it can not be used on court anyway, so if they want to take your phone to use against you in the court of law they have to have a search warrant just like they would have to have a search warrant to look inside someones home if not given permission by the landowner or owner of the house