The alignment of the rulers of society will have a dominating effect on this relationship. However, there will be other factors of importance, too. Here is a simple example: A lawful good state is at war with a powerful, evil neighbor. Almost all of the country's resources will go into the war effort—and able-bodied men and women who might otherwise be law enforcers putting down thieves will be fighting in battles instead. Thus, thieves will find life much easier than usual in such a land. From the patterns below, some will obviously tend to align with certain alignments, and this will be reflected in the guild design process later. But nothing is ever cut and dried, and 100% predictable!
Persecution[]
Typical of lawful and non-good societies, officers of the law are vigilant against thieves and their guilds. They are not easily bribeable, and there may be rewards (money, medals, etc.) for watch officers arresting many thieves or busting a guild. Penalties for thievery are usually harsh. There will be very few corrupt officers of the law. Busting a captured thief from prison will be very difficult—prisons and gaols will be strongly built, heavily guarded, and tough to get into (cue for an exciting adventure here!).
Hassle[]
The law comes down fairly heavily on thieves, and penalties for thievery are moderately harsh. However, officers of the law may feel they have better things to do than deal with thieves (e.g., in a rough-and-tumble port city), and with petty thievery in particular, a thief may get away with handing over the spoils, paying a spot fine, and getting a gauntleted hand across the back of the head. In an odd way, the thieves may even have a sneaking regard for the law: the law is firm, but fair and not arbitrary or excessively harsh, and the thieves feel they are up against an enemy worthy of their skills.
Opposition[]
This is perhaps the commonest state of affairs. The officers of the law do their best to prosecute the law. However, a small number are corrupt, they don't have enough manpower, they know their chances of recovering stolen property are very low and this adversely affects morale and motivation, and so on. The lawmen aren't uncaring, they're just somewhat disillusioned and their morale isn't so good. They will perk up and make a determined effort to find out who has pulled a big heist when one takes place, and if thieves resort to real violence they will really come looking for them. Otherwise, they just go through the motions. One or two bright and enthusiastic younger officers may resent the cynicism and world-weariness of their elders, but not for long; they soon capitulate to the prevailing attitudes.
Many thieves with experience in such places have a proverb which (there are several versions) runs along the lines of, "if you get round the corner you're a free man"—that is, get away from any watch officer in the street with your pilfered gains and you won't exactly be chased with real determination.
Tolerance[]
The picture here might seem to be similar to opposition, but the law is still weaker in dealing with thieves. This may be for a variety of reasons. Under-funding and under-manning may be especially important. Significant corruption may be present (especially higher up the scale). The society may be chaotic or anarchic. There may be a reason why thievery is not a major worry (a weak thieves' guild, major external threats to a city-state so that most able-bodied men are in a fighting militia, a very rough port where serious assaults and worse are a much bigger headache than thieves, etc.).
In such situations, the law not only doesn't do anything about all but the most serious thiefly crimes, but officers of the law may even get testy and irritated with people who complain about them too much, especially if they are foreigners!
Corruption[]
Here, bribes and backhanders are paid to officers of the law on a regular and major basis. Not all lawmen may be corrupt, but a thief with serious financial resources can manage to avoid being charged with almost anything. If somehow he ends up in prison, he will be smuggled out somehow. Law officers may actually be members of the thieves' guild, cooperating with smuggling, protection rackets, and the like.
There is a tendency to overplay this, and to make it too obvious to PCs. Corrupt law enforcers aren't going to advertise the fact, even in a corrupt society, save for the most stupidly sociopathic. Corruption may be extensive, but will still be significantly behind the scenes, making it more deadly for the unfortunate outsider who blunders into it. Lawfully-aligned PCs can arouse the ire (and even the violent attentions) of corrupt officers of the law they attempt to "assist" with their work!
Complex/Mix[]
This covers a variety of more detailed or subtle relationships. An obvious example is an opposition within the forces of law, which can be exploited by thief PCs (or by a DM with lawful PCs too). For example, in one city the dominant relationship between thieves and law officers is corruption. Senior officers, and many of the watchmen, are corrupt, and readily take bribes. A small number of decent but disillusioned juniors have tried to get firm evidence to nail their superiors and try to eradicate the corruption, but they haven't been able to manage this yet. Objective evidence hasn't been accumulated, and witnesses are too scared to talk. There is concern that even some of the judges and magistrates are in the pockets of criminal bosses or the Guildmaster of thieves. Cue for lawful and/or good PCs to help out in a dangerous urban jungle of intrigue and treachery...
Relationships may also be mixed. Thus, in one city ward, the commander of the ward watch may be an iron-willed, ultra-lawful, dominating man who drills his men to persecute thieves night and day. In another, richer ward at the far end of the city, the inexperienced new junior leader is a follower of a kindly, somewhat impractical faith, and does not think that crime deserves stern punishment unless violence is involved. His men don't respect him, though, because of his inexperience. Morale is falling, and an increasing number of watchmen leave public service or else just don't care about enforcing the law any more. One city, two radically different sets of possibilities for thieves. There may be major tensions within a guild, as the thieves from the "tough end" of town start trying their luck uptown!
Many possibilities exist in the Complex/Mix end of the spectrum. The other themes can be mixed and varied to create many possibilities themselves. The only limit is the DM's imagination.