I think what's in Jimmy's favour there is that the audience will know he's saying it to be shocking and that he doesn't in any way mean to be offensive. I know Jimmy knows the holocaust is one of the worst human tragedies ever.
Perhaps the same is true of Ricky's joke, I haven't heard it yet.