We have found that most Wal-Mart stores will allow you to spend the night unless there is some local ordinance to prohibit it or if they just don't have the space for customers and RVs too.
As to the safety there, it is generally safe enough unless the store happens to be in a bad neighborhood. You always need to use good judgment in where you park. If you are not comfortable just leaving a care in a location, then you probably should not spend the night. In general, they are more safe than would be a highway rest area, but less so than in an RV park.