Robot dogs do exist (usually of the working breeds), but they generally don't act independently with varying conditions, they just wait for commands. If someone throws a large mail bag over you and whacks you in the head with a length of pipe, without any verbal or hand commands, the dog will probably just stand there and watch.
The SAR dog training books are pretty clear that part of the training is protecting their handler, and other friendlies, if threatened without command. Those dogs also constantly react to changing conditions and are trained to deal with them calmly and appropriately. These dogs operate off-lead but rarely out of sight of handler-partners. Robot dogs, if they exist, would not make the grade. Any dogs selected for intense and constant training of the first year or so that do not work out are returned to the breeder as part of the purchase ccontract. Training is usually by owner under the supervision of very experienced trainers and their is frequent supervised testing and training of both owner and dog.