Yes. "Octane" rating is the ability of gasoline to RESIST being ignited before the spark plug fires. The higher the octane, the harder it is to light off. One of the reasons you see great big dual magnetos on top fuel dragsters. They need the most spark they can get to get the very high octane fuel they use lit off. (OK, there are other reason too)
On a street car, you can get more power with more compression, a camshaft change, more advanced timing, etc. All stuff that contributes to to detonation. Sustained detonation leads to engine destruction. Period. A simple way to combat the problem is to run a higher octane fuel. You will actually give up some power over using a lower octane fuel but it's way more than offset by the gains to be had with high performance tuning and parts.
For the best power, you should use the lowest octane rated fuel you can while keeping the engine out of detonation. The first sign of detonation is pinging, the last sign is generally big holes in the tops of your pistons.
I remember one magazine (Hot Rod maybe?) got bored enough to dyno a stock car that was happy with 87 octane. They changed its fuel over to 110 octane race gas with no other changes and dynoed it again. In stock form they lost something like 30 horsepower. A hefty hit on a car that didn't make a whole lot of horsepower to begin with. Some minor tuning of the car to make it run better cut the loss to around 25 horsepower on another run. Thus proving using too high an octane fuel can be a bad thing along with a big waste of money. The article's still out there somewhere if someone cares to find it.
Diesel is another animal. Diesel fuel is rated in "cetane". Cetane is a fuel that burns PDQ. Diesel fuel mixes are rated as to how well and quick they ignite compared to cetane. Thus the higher the cetane rating, the more power can be gotten out of the fuel. Diesel cetane ratings are pretty much what most people think is what's going on with octane ratings which are actually the opposite.