In my experience, as long as you ask first you likely will have no issues. The management of whatever store will know if there is a local ordinance against overnight parking, and if it's enforced, or even how it's enforced.
Or, if its late and a place is closed, find a local police officer and ask them if they know of any place you can stay. As long as you don't come off as someone they want to look into, they know their beat and know places where you'll be left alone, and those place will likely be much quieter and safer. I've done this several times.
And, as a former LEO, I have done this for travelers many times as well.
A little effort can go a long way for peace of mind.