Do liners or other hats worn inside a helmet compromise safety?
I've never heard of sweatbands, bandana's, or caps being problematic. Curious about what prompts the question? 

The only thing remotely similar that I have heard IS a potential issue is plastic sun-visors attached to helmets. Apparently these things can come loose in a crash and scratch/poke the face. 

But linings? No way.

Here's a summary of what is involved in the helmet testing used to certify helmets for CPSC, ANSI or Snell compliance. Any issue related to hair or lining would conceivably be addressed by a "rolloff" test. However, in testing the helmet is merely strapped to a form that represents a head size. The standards have no indication related to what's under the helmet other than the size of the form (to test different size helmets). More complete description of testing here.

If there is any design or safety accommodation for lining under a helmet, it would probably be addressed by the individual manufacturers, but I've never heard such a thing mentioned except that some helmets are better with ponytails.

That said, linings of some form or another have been used widely since helmets have started to be worn. I'd like to know if anybody has heard of any real mishap related to linings under helmets. I suspect there is none.

oh... looking further on the bhsi.org, I see there is an article on hair and helmets.