Etymonline offers this:
pickle mid-15c., probably from Middle Dutch pekel "pickle, brine," from a Low German root of uncertain origin or meaning (cf. [...] German pökel). [...] Figurative sense of "sorry plight" first recorded 1560s.
The Phrase Finder supplies some background:
The figurative version of the phrase, meaning simply 'in a fix' [...] arrives during the [16th] century. Thomas Tusser's Five Hundreth Pointes of Good Husbandrie, 1573, contains this useful advice:
Reape barlie with sickle, that lies in ill pickle.
There are a few references to ill pickles and this pickle etc. in print in the late 16th century, and Shakespeare was one of the first to use in a pickle, in The Tempest, 1610 [Act V, Scene 1, Line 2354]:
And Trinculo is reeling ripe: where should they
Find this grand liquor that hath gilded 'em?
How camest thou in this pickle?
I have been in such a pickle since I
saw you last that, I fear me, will never out of
my bones: I shall not fear fly-blowing.
Follow the links for additional insight.