I was in Spain on my way to the 2010 European hitchfestival when two nice fellows stepped out of the car to inspect my papers. They informed me I couldn't hitchhike here.
I contested. They double-checked and wished me a nice ride. The same occured a couple of months later, with different police but again in the same country.
In some countries police can give you a hard time. They send you away for example, or even want to check your bags and everything. But most of the time you are fine. I generally just stay nice to them. I think it is easier that way.