Is there an escrow-like mechanism that doesn't involve a trusted 3rd party? We know that escrow mechanisms are easy to implement when it involves a trusted 3rd party. For example if A and B don't trust each other they can simply send their goods to C whom they both trust. Then C can distribute the goods to them fairly.

However, is there a primitive that achieves the same when there isn't a trusted 3rd party? Basically, A and B don't trust each other and they want to exchange something. Can they do this without involving any trusted party?
Yes they can! 

This can be done through a public blockchain like bitcoin for instance.

Other blockchains such as Ehtereum provide more functionnalities like Smart Contracts. These would enable both parties to send their goods (cryptocurrency/ digital property of some good etc.) to a decentralized application - DApp - running on the blockchain (basically, a piece of logic code that would be cowritten by the two parties so it would wait to receive the expected goods from the expected parties until realeasing it to one another, effectively acting as a decentralised, no TTP, automated, bot-escrow).