Polly's strange song about Jenny the Pirate gives us one image of freedom, where a woman who doesn't seem to have many options—a barmaid in a harbor town—suddenly up and attacks the city and leaves on a pirate ship. Finding freedom, then, is a violent, revolutionary act.
BROWN. Well, just for today I'll turn a blind eye. (1.2.398)
Jackie Brown is Mac's old army buddy, so Mac the Knife has a sense of security in his criminal activities because the sheriff is on his side. Turning a blind eye is Brown's specialty, but his phrase "just for today" foreshadows the coming betrayal. Mac's sense of freedom is false.
SMITH. Coming quietly?
MAC. Is there only one way out of this dump?
Smith tries to put the handcuffs on Macheath; Mac gives him a push in the chest and he reels back. Mac jumps out of the window. Outside stands Mrs Peachum with constables.
MAC with poise, very politely. Good afternoon, ma'am. (2.5.132-137)
Even when he's under arrest, Mac doesn't quite believe that his freedom is being taken from him. And he turns out to be right, really. But it's pretty comical. Instead of going along with the sheriff, he jumps out the window. He's so sure that things will turn out okay that he greets Mrs. Peachum as though he were out for a stroll and not running for his life.
MRS. PEACHUM. through the window: Ladies, if you wish to visit him, you'll invariably find him in. From now on the gentleman's address will be the Old Bailey. (2.5.145-147)
Mrs. Peachum plays along with Mac's gentleman-thief act. His "invariably" being home to receive visits is a euphemism for his confinement in prison, and the "address" is a nice way of saying that he'll be in the clink, the slammer, the big house, the inside, the hole, the hoosegow… you get the idea.
MAC tied with heavy ropes, accompanied by six constables, enters with head erect. Well, flatfeet, thank God we're home again. (2.6.14-15)
The farce continues. Just as in the previous quotes, Mac treats the jail as his "home." Rather than being upset because he's confined, he acts refined and unworried. Why? Because he knows as well as you and I that the cops are corrupt, and that he has as much freedom in jail as he does on the outside.
What use is freedom? None, to judge from this. (2.6.63)
Mac's song reveals that he doesn't play by the rules of society. Law means nothing to him, and whether he's in jail or free to roam doesn't really make a difference either. He sees that the world is a mess (another theme in the play), and so he doesn't see why anyone would want to follow the rules and live a difficult, bleak life.
PEACHUM. What's going on, you haven't given them any money, I hope? Well, ladies how about it? Is Mr Macheath in jail, or isn't he? (3.7.47-48).
Peachum believes that he controls Mac through legal channels, like reporting crime and having him sent to jail for his dastardly behavior. He does, however, use the prostitutes to trap Mac, and will only pay them if he's gotten what he wants. His idea of legality is fuzzy, at best.
PEACHUM. Look here, Brown, since you're passing by, passing, I say, Brown, I may as well ask you to put a certain Macheath under lock and key, it's high time. (3.7.128-130)
Peachum might seem like a concerned citizen by reporting Mac and asking that he be confined to prison, but it's his own freedom he's worried about. Jackie Brown is inspecting Peachum's shop, which is not exactly legit, and Peachum' also irritated that Mac has "married" his daughter Polly, taking away one of his shop's attractions.
MAC. Here hangs Macheath who never wronged a flea
A faithless friend has brought him to this pass.
And as he dangles from the gallowstree
His neck finds out how heavy is his arse. (3.9.203-206)
Mac's confinement is set to end in the ultimate loss of freedom: execution by hanging. Once again, Brecht contrasts the serious subject matter of the play with nursery-rhyme-style poetry. The ABAB rhyme scheme and the crude language clash with the fear of death that Mac must be feeling.
BROWN. I bring a special order from our beloved Queen to have Captain Macheath set at liberty forthwith—All cheer.—as it's the coronation, and raised to the hereditary peerage. Cheers. (3.9.347-349)
Wait a minute… that's not fair. Mac is the biggest, most notorious criminal in London, and now the Queen has called him "Captain," set him free, and even given him a noble title so that he can collect money and have other perks that those with "hereditary peerage" get. That is real freedom in the play, and it only belongs to those in power.