That is correct, if a police or military dog is performing his or her duties, and they bite someone in that capacity, then no legal liability under California law.  Here is the law on it:

3342.5  (d) Nothing in this section shall authorize the bringing of an action pursuant to subdivision (b) based on a bite or bites inflicted upon a trespasser, or by a dog used in military or police work if the bite or bites occurred while the dog was actually performing in that capacity.