The Americans with Disabilities Act (ADA) is the main law governing Service Dogs, except on airplanes because “the Air Carrier Access Act is the Federal law that protects the rights of people with disabilities in air travel”.
The Americans with Disabilities Act says that a Service Dog must be trained specifically for a person with a disability. That means it can’t just be a general-purpose assistance dog, but rather it must be trained specifically for one person.The person who is getting the dog must have a disability that rises to a level that the Americans with Disabilities Act considers a disability. A good rule of thumb is that if a person cannot work, then they’re disabled. (This is not always the case, but it’s a good general rule to follow.)
The dog must be trained to do a “task.” The term is not strictly defined, but three of the most clear-cut tasks are helping lead a person who is blind across the street, alerting a person with severe diabetes that their blood sugar has dropped dangerously low, or picking up items for someone with limited mobility.
There are no limits to the size or breed of dog that may be used as a Service Dog. However, one may not have a service cat or any other animal (except for miniature horses).
If you live in the United States and have a disability, you benefit from the forward-thinking Americans with Disabilities Act. Most countries, unfortunately, do not have such broad protections. many only legally recognize service dogs for people who are blind. There are a few, however, who legally recognize alert dogs (for diabetes and epilepsy), mobility dogs (for pulling wheelchairs, picking up dropped items, turning on/off lights), and signal dogs (for the deaf), but very few recognize service dogs for autism or psychiatric disabilities such as Post Traumatic Stress Disorder. The rest of the law says (generally) that a Service Dog must be well behaved and must be leashed. Other requirements are that the dog is in control and that the dog is housebroken. These two points might seem obvious, but when you get into the issue of fake Service Dogs, these two elements can be helpful in demonstrating the difference between a real Service Dog and a fake one.
The law goes into where the dog and handler can go, which is defined as "where the public is normally allowed to go". This wording implies that the handler can bring the dog into businesses, nonprofits, churches, and even schools.
The law also goes into what a staff person can ask about the dog, which are two questions - one is to confirm that the dog is required because of a disability, and the other is to ask what task the dog performs.
The federal law does not get into whether there are exceptions for Service Dogs in training, so that is sometimes a gray area, depending on your state. A good rule of thumb is to follow the law that Minnesota passed in 2015 (256C.02 Public Accommodations), which states, "Any person training a dog to be a service dog shall have the right to be accompanied by a service dog... The service dog must be capable of being properly identified as from a recognized school for seeing eye, hearing ear, service, or guide dogs." The term "recognized school" can be interpreted being registered with the Secretary of State as a local nonprofit.
If you need the exact wording of the Americans with Disabilities Act, it is here
and the official memo describing the law is here.