Yes, you can leave the airport during domestic layovers. For instance, if you're a US citizen and have a layover within the country, it is legal and safe to leave the airport. Be aware that you'll probably be getting two boarding passes if the domestic layover is more than an hour.