OK ... I HAVE to tackle this subject because I've found that it so often comes up in musical conversation and is massively misunderstood. The usage and avoidance of parallel fifths and parallel octaves.
My idea is to try and get the basic understanding across of when we do and don't use these devices and most of the reasoning why. As it can be a bit of a touchy subject I had the article double-checked by two musicologists: Maria Antal and Yaiza Varona.
So What IS This Rule Anyway?
Ok so here's a basic paraphrasing of the rule:
When writing music of independent voices, no two voices should move so that they both begin and end as fifths or begin and end as octaves.
What's really important to note is that we are talking about independent voices here. This style of writing (known as homophonic) involves creating harmonies whilst maintaining independent moving individual lines such as four-part harmony writing. It was found that if two voices (particularly literal voices in choral music) moved in parallel fifths or octaves then the higher voice sounded as though it were an harmonic of the lower voice. In effect it felt as though one of the voices had disappeared and this was considered to have reduced the effectiveness of the overall writing. As a large part of the attraction of this style is the way that the lines are both melodically satisfying individually and as a whole. Parallel fifths or octaves are usually considered weak choices where more interesting voice-leading opportunities are available.
So we are talking about a very specific rule designed to help deal with independent part writing in orchestral and choral music.
There are further more specific extensions to this rule dealing with other cases but suffice to say that they are all applicable to independent part writing.
So What Does This Rule Specifically NOT Apply To?
One of the first areas of confusion is the whole parallel octaves thing. "Wait a minute, I have a whole TON of parallel octaves in my orchestration. Am I doing it wrong?" Well, obviously not. Arranging in octaves is a classic device. Heck the double bass is named so because it often doubles the cello an octave below. The point is that you are taking an independent voice and doubling it in octaves. All of the instruments/voices are acting as a thickening of the one voice. This is the big difference.
One way to look at it would be to write a 4-part harmonic idea in straight SATB. Ensure that the voice-leading is correct with no parallel octaves or fifths. Once this is complete you could then orchestrate the arrangement and here you would likely decide to double voices at the unison and octave between instruments. The original 'voices' would still have been written independently.
A lot of composers of the early 19th century were influenced by folk music and they would often add fifths as well to thicken an individual line. Again this does not break the original rule because the two voices are not independent. It creates a very distinctive effect and is quite modern sounding (so wouldn't be necessarily appropriate for older classical music for stylistic reasons) but doesn't break the original rule.
I had considered going into further and further detail on this but I think the point is very simply made and I don't want to clutter it with further details. I'd be very happy to discuss more in the comments.