A. The dog ran out / of the office.
B. The dog ran / out of the office.
A is, at best, poorly worded.
If out is an adverb, it means outside, as in 'The boys played outside of the office'. Thus: 'The dog ran (ran around/exercised) out of the office.' The dog did not exit the office. The dog is already out, running.
So, your sentence should be parsed:
'The dog / ran / out / of the office.'
This is similar to
'The dog went out of the office.'
Again with out as an adverb, the dog is not exiting the office. It means the dog 'went' (urinated/did its duty) out of the office, as opposed to in the office.
To show that out is not an adverb your sentence, consider when out is an adverb, it can change position in the sentence. The following are both fine, with out as an adverb:
'I opened the door and the dog ran out.'
'I opened the door and out ran the dog.'
However, to show that 'out' in the following is not an adverb, but part of the compound preposition, try to move out as we did before.
I opened the door and the dog ran out of the office. (out of is a preposition)
*I opened the door and out ran the dog of the office.
Here, 'of the office' has become part of the noun phrase 'the dog of the office', so the sentence has changed meaning. Out is not an adverb in your sentence.
By changing 'of' to 'from' the sentence takes on new meaning, and also a different verb:
We have the prepositional verb run out. This is not the same as the verb 'run' followed by the adverb 'out'. Rather it is a lexical unit which consists of the verb 'run' and the preposition 'out'. The prepositional verb can be followed by a prepositional phrase.
The dog 'ran out' the door.
The dog 'ran out' from under the bed. (From under is a compound preposition.)
A subject / verb / prepositional phrase
A1 The dog / ran out / from the office.
A2 The dog / ran out / from under the bed.
The verb run out is intransitive here.
Let's look at B.
Out of is another compound preposition. So the sentence is
B subject / verb / prepositional phrase
B The dog / ran / out of the office.
The verb run is intransitive here.
Run can be transitive:
Bt The dog / ran / the cat / out of the office.
subject / verb / dir object / prep phrase
Note: here run means to force.
There is a C version, which uses the verb run out of.
This verb is transitive and means to 'use up' or 'reach the end of the supply of'.
C subject / verb / direct object
C1 The dog / ran out of / food.
C2 The dog / ran out of / energy.