This one is tricky. You just don't have the same rights when trying to enter a country as you do if you're stopped by the police. Border officials have the power to deny you entry and generally there's very little recourse if they do. This makes you way more vulnerable and likely to cooperate than you would, say, during a routine traffic stop.