You are allowed to refuse access to your device, and they are allowed to refuse entry to the country.