According to recent studies, yes! Take, for example, the nematode. This little worm enters an insect, and when the time is right, realeses the bacteria that it is holding into the unfortunate prey, killing it. No one is yet sure why or how the worm knows which bacteria, but they think that the worm can recognize the proteins on the outside of the bacteria! Pretty cool, huh? Also, the Hawaiian Bobtail Squid, a tiny squid, uses the same bacteria that causes whooping cough, and gonorrhea in humans, which in the squid is responsible for the development of vital organs
! This suggests that the behavior of the bacteria depends on the host!