"That doesn't give you immunity."
"That does not grant you immunity."
Yes, I believe these two can be used interchangeably.
"That doesn't excuse what you did." - To excuse means to give a reason to lessen a negative situation. This sentence is saying 'That does not make what you did any better, what you did was still bad.'
"That doesn't justify what you did." - To justify is like giving a logical/moral reason to a negative situation. So this sentence is saying 'that does not mean what you did was the right thing to do. You are still wrong for doing it.'
You can use them interchangeably, but they won't really mean the same thing.