yes they can...if you’re coming into the US. Ever try to get something mailed from overseas? By your logic you can smuggle drugs in and espionage data.
If you legally own a device the US Government can’t confiscate it unless you submit to their jurisdiction by living here or voluntarily entering the country.
If you show up and they ask for your phone you can a) give it to them and enter, or b) keep your phone and return from whence you came.