It's very common, at least in Italy, to see bottles of water near walls in sidewalk and I've been told it's because it prevents dogs and cats from peeing on the wall. Is this actually the case and why wouldn't a dog/cat pee on it?
This thing is most likely not effective.
While not highly scientific, Mythbusters did test this on cats (Episode 214). The result: cats completely ignored the bottles.
This answer is based on my much longer and more extensive answer to a LifeHacker.SE question on the same subject:
The Cats Away Blog declares it to be a myth:
The practice is so popular in fact that a year or two ago a Japanese breakfast TV show decided to put it to the test and while you might not understand the commentary, it is pretty obvious that they put the superstition to bed once and for all.
Snopes rates it as undetermined, not showing any evidence either way:
Is there anything to this notion or not? Who knows?