You can legally give a dog or most animals pretty much anything so long as you remain in compliance with prevention of animal cruelty laws. You can get medication at a farmer's market or similar that'd be highly regulated for human consumption, so long as it is marked appropriately.
dogs can take all sorts of human prescriptions, including allergy meds and pain meds. also OTC like benadryl. it's kind of mind blowing. of course, some meds will simply kill them, so uh, do your research.