Consider, all Robots stories are short stories or novellas published during a very long time spawn, so they are not 100% coherent among themselves sometimes, though the overall framework is.
As highlighted in the comments, Positronic brains reaction to orders, situations and environment is generally described in-universe as the outcome of the "potentials" induced by them on the 3 Laws. There is no AI at work as we know it today for the Robot to decide to do something or not, but more like a compulsion towards a generic line of action, driven by priorities between the laws and the Robot understanding of his surroundings. To give you an idea, there is some discussion in one of the stories if I remember well on a potential scenario where a strong enough order, repeated continuously under different wording and reinforced with information on how negative would it be for the person issuing it if not followed, could have potentially led to a breach of First Law by simple buildup of potential on Second Law adherence. The idea is rejected as impossible in practice, but it is discussed.
Also take into account there is an in-universe evolution on how Laws are enforced by design; in the first stories, which are supposed to take place earlier in-universe, Laws are rigid, literal absolutes with no space for interpretation. As in-universe timeline progresses, they become more flexible and open to interpretation by the Robot, in part as an attempt by US Robotics to prevent scenarios such as a third party ordering a Robot to, for instance, “get that bike and throw it to the river”, when the bike owner is not present to negate the order.
This flexibility is often presented as a re-interpretation of First Law, where “damaging a human” is originally presented as implying exclusively physical damage, and it slowly includes the concept of mental damage or distress. Under this implementation of the First Law, breaking it is to build up enough negative potential vs. it as per Robot understanding of human mind and social conventions, which leads to amusing side-effects (read the books!).
So the bike will not be thrown to the river because the robot guesses the owner will not like it (negative potential vs. First Law).
So, what does all this rambling mean to your question:
- An early Robot will tend to do as ordered literally if there is no
evident violation of First Law, or a violation of a stronger previous
order. A way to protect your Robot from abuse would be to issue a
second order in strong terms not to obey counter-orders. This will
generate two positive potentials a single counter-order will find
difficult to overrule.
- A later Robot will tend to be more mindful of negative psychological
impact of following an order or taking a course of action, which
leads to amusing side-effects (seriously, read the books!).
- Any Robot of whichever period, faced with a situation where
contradictory lines of action will have the same potential on all
Laws, or inevitably break First Law (later interpreted as leading to
a negative high enough potential vs. it, not necessarily implying
physical damage), will enter a loop looking for an impossible
solution and be blocked.