Sheriff of Nottingham - Is the sheriff allowed to take your bribe and still search your bag?
No.
The sheriff can either take the bribe or search the bag, not both. From the rules, in Phase 4 (Inspection):

When the Sheriff has made a decision about a Merchant Bag, he has two choices:

Accept whatever final bribe was offered (if any) and hand the bag back to its owner; or

Reject any bribe that may have been offered and unsnap the Merchant Bag, revealing the cards inside.