Q:

When can ‘dus’ be used in place of ‘du’?

Here are two usage examples of dus from dictionary.reverso.net: 

Wenn dus nicht besser machen kannst, dann mach es genauso. → If you can't beat them, join them.
Wie hältst dus mit der Religion? → What's your attitude toward(s) religion?

A:

"Dus" in fact isn't a word on its own, it's simply the result of colloquially merging the two pronouns "du" and "es" into one. IMHO, you should refrain from using "dus" in written language.
Theoretically, "Dus" may also be understood as the plurale of the word "Du", in the sense of "Ich denke, alle die 'Dus' in dem Brief sollte man groß schreiben". But IMHO this is colloquial, too.
Quite often, you will come across combinations with "es" where the "e" is dropped and the "s" is attached to the previous word also in written language, in direct speech. For example (from Duden, canoo.net and Wikipedia):

„Wie geht's?“
„Maria, ihm schmeckt’s nicht!“
„Wie man’s nimmt.“

In this case, i prefer to use an apostrophe to indicate that a vowel (the "e" of "es") was dropped. But 
using the apostrophe is optional in those cases. See

„Wenns schee [= schön] macht!“

NB: The Google result for the last sentence is a nice example that both variants "wenns" and "wenn's" are common.

