I would like only to summarize the answers of gianni and singleview
you can have the "d" sound in two cases:
- when you have the preposition "di" and a word beginning with a vowel
una terra d'oltremare (a land beyond the sea) etc.
however, you don't have to eliminate the "i" every time you have a word beginning vith a vowel immediately after, especially in the written language
ho voglia di andare al cinema (i would like to go to the cinema)
"d'andare" could be used in speaking but it's not used in the writing, it's considered not sounding great ^^
- when you have a vowel as a preposition and then a word beginning vith a vowel:
siamo obbligati ad andare (we are forced to go)
puoi restare od andare via (you can stay or leave)
tu ed io (you and me)
to sum up, in the end, it could be difficult to pronounce two vowels which are near;
so you can remove the "i" of the preposition "di"
or add a "d" to a vowel-preposition
to have the sound "d"