AFAIK it's legal to set up a trigger that wipes a device. It isn't legal to choose to wipe your device after you know the government wants the data. Tricking the government into wiping it is still allowed, especially if you tell them not to do that.
There are videos on youtube where the lawyers tell you what your rights are at traffic stops, also there are ones that talk about the different rules when coming through immigration. These can be painful to see when they show the ones where cops ignore limits.
So at the border, they tell you that you are legally required to provide your finger print, you do that, and don't say a word. I'm sure it will be a bad day for you, regardless of how it works out after years of litigation on whether it is your duty to tell them how NOT to unlock your device.