Rashmi, I think that one of the ways that this can happen is when a dog lives in an environment where there are multiple people within the dogs life (pack) and giving it commands. The dog kinda gets used to many people telling it what to do. The only way that you can prevent this is to be the only one that the dog has contact with as far as training is concerned & even then some dogs are more biddable to people. The only way to fix this would be to correct the dog when a command is given by someone other than you that the dog listens to. My female will usually only listen to me & to my son, some of the time, (she was raised with him living in the house at that time)& sees him freequently now. As far as anyone else that she knows & has a relationship with (my friends that she sees often)giving her commands...she may occasionally listen if she feels like it or not. I do not praise her or repremand her when she does either. I pretty much ignor it. I don't particularly want her to listen to anyone except me (& my son in my absence) but she also doesn't do it enough at this point to correct her for complying. If she were to listen with some regularity, I might consider correcting her. My male is pretty indifferent & aloof to others. He will very rarely listen to my son that he sees freequently. He is not too interested in bothering with others, especially strangers, let alone listen to them if they give him a command.