O.K, yes, as 暗水蓝月Scarlett said, this is used to counter the argument, that things are not always as they appear.
All too often people will try to say there must be another reason something happened, that the real reason is not the only possibility. This duck saying is often used when talking about people, yes, sometimes bad people who are always doing nasty things, saying nasty stuff etc will not be like that, but people tend to always try and say he/she is not really like that, so then someone will say, you know? If it looks like a duck, walks like a duck, and quacks like a duck, it must be a duck! Maybe yes, this person is just really a nasty person!