If your engine is knocking under load, yes, higher octane can help prevent predetonation damage (like head gasket). If you go up Brock Hill and you hear marbles bouncing in a coffee can, that is the knocking. That is damaging over time. Usually the car's computer pulls back the timing so to prevent this, so you'll never hear it, but car will be slower.
Octane rating is resistance to predetonation. That's all. Not a fix, but a band aid.
Which is why higher octane is REQUIRED/RECOMMENDED on high compression, turbo/supercharged engines. Read your owners manual.