Legally actionable discrimination has to do with a person receiving less favorable treatment due to their race, religion, nationality, disability, etc. There is no protection that covers a situation such as you have described. Accordingly, this prospective employer was within its legal rights to set the conditions of the application process much as it saw fit, including not hiring your friend for what was shown on the hat that he was wearing. The only exception might be if turning your friend down for work under the circumstances breached the terms of any applicable union/collective bargaining agreement.