Yes, normally they are. It is not dangerous to stay at a truck stop overnight. Most of the truck stops have no restrictions on the duration of stay, however, some of them restrict this to 2-10 hours. So, you have to keep in mind that some truck stops in different states might have their own rules, so it is better to know them before planning your ride.