I have anxiety that I cannot find a bathroom whenever I go out. Can I take imodium (loperamide) even though I don't have diahrea?

Yes, but ... I would not do that more than 2 or 3 times per week if i were you, even if it means staying at home. Your doctor needs to help you find the cause of your anxiety and treat it accordingly or refer you to someone who can.