In most parts of the world there are no laws against hitchhiking.
However, in some parts in this world it's officially illegal to hitchhike. Practically, in many of these, such as Pennsylvania, it's de facto allowed and no one will be fined. Be cooperative with the police though, since even if you think it's legal, they might fine you for anything they can think of, such as loitering, vagrancy, or just standing in the wrong spot.
In Australia guaka and amylin were harassed by a cop who said it was illegal and who said they would be fined if he'd see them again. Fortunately they quickly found a ride with a friendly trucker in a gas station.