Dogs, on or off a leash, are simply not welcome in many places. Usually, taking a dog to a beach, zoo, restaurant, or farm won't make you any friends and may get you a quick and stern request to leave. State and local laws ban dogs, for health reasons, from places food is prepared, served, or sold. Some cities also bar dogs from city parks.
Surely, though, you can let your dog run in wide-open spaces? It depends. On federal land, the rules change from area to area. In officially designated "wilderness" areas, dogs are allowed on a leash, but the leash requirement is rarely enforced where there are few people and even fewer park rangers. Some national parks and national monuments allow dogs on leashes; some don't allow dogs at all. In national forests, dogs are usually allowed in at least some areas.
State and local rules are unpredictable. Most trails and campgrounds of the California State Park system, for example, are closed to dogs. Check the rules before you load your backpack (or your dog's) with kibble and set off.
Assistance dogs. Guide dogs, and often other specially trained assistance dogs, are allowed many places other dogs aren't.