In these cases context extends over words boundaries: In
"a que Deus deu" ("which God gave")
both occurrences of phonemes /d/ are realised as the [D] allophone,
because of the e and the s in the preceding word.
Likewise, in "asas inúteis" (useless wings), both phonemes /s/ in the word "asas" sound as [z], because of the following vowel, regardless of whether that vowel is in the same word or in the next. An isolated "asas" has [S] for the second s, because a pause or other non-vowel follows.
In these cases context does not extend over words boundaries:
A written s at the beginning of a word will always sound
as /s/, never as /z/, regardless of whether or not the
preceding word ends in a vowel.
Likewise, an initial r remains /R\/ and doesn't ever become /r/ under the influence of a preceding word.
Likewise, a word final r does not behave like a word-initial pre-consonantal r just because the next word starts with a vowel: it remains what it is: a final r.