But yeah, if the government wants to fuck with you, they can surely fuck with you. Your best defense is getting a lawyer asap and not talking to the cops without a lawyer.
EDIT: It seems like Immigration is treated differently from other criminal cases. But it seems like if you're arrested by the typical FBI agent (ie: some sort of crime), you're gonna get Miranda Rights read to you, and the option for a free public lawyer.
All the lawyer probably will say is refuse entry until the cop shows a search warrant, and speak as little as possible.
There are some abusive states out there when it comes to foreigners. Arizona for instance is famous for having abusive laws / cops towards foreigners. (Arizona SB 1070, part of which was struck down as Unconstitutional however). So its important to remember that the law changes from State to State (its only natural in a country that is ~3000 miles wide).