In the US at least, a response to a survey (verbal or written) is a form of speech. You can't be generically compelled to give accurate, truthful answers to all surveys you'll ever encounter. Certain official government surveys (the census, etc) are sufficiently important to justify mandatory truthfulness, but that list is rather short and those surveys will include a warning/disclaimer indicating that this is the case. When it's that important, they'll want to make sure you're aware of it and can't claim ignorance later.
Surveys between you and a private party (such as a business or employer) might be subject to terms of a contract. Your employment contract (for example) might have a clause that requires truthful responses to employee surveys. If that's the case then lying wouldn't be illegal in the criminal sense, but it could put you in breach of contract and expose you to civil suit or any penalties the contract outlines.
In order to enforce a penalty for lying, the surveyor would have to:
- be able to trace responses back to the individuals who submitted them
- have some way to discover the correct answer on their own and compare it to the provided response
That means that there's no meaningful way to enforce a truthfulness requirement on an anonymous survey. For nearly all of the surveys you'll ever see, the survey only exists because the surveyor has no reasonable way to gather that data on their own. Thus, they would be unable to do the second item. The exceptions would be things like the census, where the raw data can be gathered directly but is too onerous to do as a primary way of gathering data. These are the cases with the nice big warning at the top that quotes the relevant statute about truthfulness in responses.
Regarding your example survey, allergies are personal health information and protected by laws like HIPAA. Your employer can't require you to answer that question truthfully or even to answer at all. Merely asking the question is enough to make some lawyers nervous.
From a statistical standpoint, well-designed surveys should accommodate for this. Results are published with a margin of error, and responses are over-sampled so that bad data gets drowned out by accurate data. The number of respondents who fabricate results is generally much lower than the number who provide incorrect information by mistake. Compensating for these honest mistakes will compensate for the misleading responses as well. Misleading responses will have a larger impact in surveys with a very small number of overall responses, but the margin of error in such surveys is already rather large. For that reason, it would be quite difficult for an employer to argue that your specific response caused them damage when their decisions were based on aggregate information. If the issue was important enough that it could do meaningful damage to them, then they should have done more than blindly trust general survey responses.