Safe where you can and spend where it makes sense.
The problem is to know, what is what.
ethanol has no effect on octane rating. If it's 87 octane 100% gas or 87 octane 10% ethanol blend, they are both still 87 octane and have the same resistance to detonation.
You should always run the lowest octane possible that won't cause detonation/pinging. This will give the most power and cleanest engine. It is not unsafe to use higher octane than required, however, it gains you no power(technically loses some, actually, as it's essentially the same thing as retarding ignition advance), and it promotes carbon buildup in the intake/combustion chamber. And of course it's a waste of money.
There is not just one thing that determines the octane needed, there are several. The two most prominent factors are compression ratio and ignition timing. The stock pcm will NOT "adjust" for different octanes. What it will do is retard timing if you use too low of an octane, to prevent engine damage from detonation/pinging. It will not advance timing.
People always want to think more expensive is better, but it's not always the case. I can damn near guarantee that if they flipped gas prices nation wide (make 87 the most expensive and 93 the cheapest) that everyone would think 87 was "cleaner, better, and gave more hp"...