SIMILAR MOTION:
CPE Bach, while discussing thoroughbass in his Essay on the True Art of Playing Keyboard Instruments, writes that although one should try to avoid direct perfect 5ths and octaves, there are some progressions in which they may be used (Figure 223):
One may also need to use hidden 5ths/8ves (even in the outer parts) in a cadence. In Figure 235, we see that the progression is faulty because the B, which wants to lead up a half-step to C, instead leads to G. The corrected example in Figure 236 resolves the B to a C, creating a hidden, but acceptable 8ve between the soprano and the bass.
PARALLEL MOTION:
Edit: Regarding parallel 5ths and 8ves, we can turn to Fux's Gradus Ad Parnassum:
...the progression at B... in direct motion need not be considered a mistake because of the difficulty of this species.
However, the editor points out writings of Beethoven in the footnotes:
"Such liberties are more acceptable in a descending than in an ascending motion." However, in his Introduction, we find Beethoven's comment on this example and this particular instance (the succession occurring between the outer voices): "The second progression, at B, would never be excusable for my ear."
Here we see that the use of parallel 5ths and 8ves in the outer voices can be decided by necessity. Beethoven implies that they should be avoided altogether, while Fux avoids them but allows a filled out form to be used as a sort of last resort if no other progressions can be found.