Forget direct/indirect objects!
There is nothing like a direct or indirect object in German grammar. German has these types of objects:
- Genitive objects
Ich gehe meiner Wege. Wir gedenken der Toten. Er wurde des Mordes bezichtigt. Sie bediente sich einer List.
- Dativ objects
Das Buch gehört dem Direktor. Du ähnelst meinem Onkel. Das nützt niemandem. Bitte antworte mir.
- Accusative objects
Sabine schreibt einen Brief. Maria isst den Apfel. Hans küsst seine Frau. Siehst du den Berg?
- Prepositional objects
Ludwig spielt mit dem Feuer. Barbara achtet auf ihre Kleidung. Der Fernsehsprecher berichtet über das Erdbeben. Kevin glaubt an den Weihnachtsmann.
(Some also say that Gleichsetzungsnominativ is another type of object (Otto ist ein Mann), but in fact it's part of the predicate.)
Open any German grammar textbook. No matter which one you open, you will not find the terms "direktes Objekt" or "indirektes Objekt" in it. These categories make no sense for German grammar. Thinking in these categories can help in 90% of all cases, but in 10% you will fail. Better learn the categories that really exist, then you have a chance to be always correct.
Answer to your question
Having said this, I can answer your question now:
Word order is much more flexible in German than in English. English has (almost) no cases, so it's hard to identify which words have which grammatical function in a sentence if the words would appear in any order they want. So in English you have a relatively strict word order, and this helps you to tell apart different parts of speech.
But German has grammatical cases, and this helps a lot to identify which grammatical function a part of the sentence has, even when it stands at an unexpected place.
So, this word order is preferred:
Bringen deine Mitbewohner die Hunde zur Arbeit mit?
(accusative object before prepositional object)
In a closed question you will find the verb at position 1 and the subject at position 2. And the former prefix of the separable verb mitbringen must stand at the very end. These places are fixed. But the rest can also be arranged in a different order:
Bringen deine Mitbewohner zur Arbeit die Hunde mit?
This order is unusual, but still correct. You can use this order (prepositional object before accusative object), when you want to emphasize the accusative object. ("Oh my god, I've heard they bring dog with them? I'm so shocked! Is it really true? Do your roommates bring their dogs to work?")