The saying or expression pig in a poke originated in the 1500's when a sack was named a poke.
In the 1500's piglets were sold in sacks which were called "pokes" sight unseen so that is where the saying buying a pig in a poke came from.
A poke in the 1500's was a sack, and merchants would sell piglets in pokes, often sight unseen and sometimes they would get a bad piglet or a runt etc.
So if you buy something sight unseen then you're buying a pig in a poke.
It's not always a good idea to buy a pig in a poke or something sight unseen.
It's best to actually see what you're buying before paying for it especially if it's something used.
However we do really buy pigs in pokes when we buy things online because we don't really see the stuff we're buying online until we get it a few days later.
But most times the stuff we buy online turns out just fine.