You should not give your dog loperamide or any other medication without discussing it with your vet first. Diarrhea in dogs can have various causes and should be evaluated by a professional.