A Distributed Hash Table is simply a key-value store distributed across a number of nodes in a network. The keys are distributed among nodes with a deterministic algorithm. Each node is responsible for a portion of the hash table.
A routing algorithm allows performing requests in the hash table without knowing every node of the network.
For example in the Chord DHT —which is a relatively simple DHT implementation— each node is assigned an identifier and is responsible for keys that are closer to its identifier.
Imagine there are 4 nodes that have identifiers: 2a6c, 7811, a20f, e9c3 The data with the identifier 2c92 will be stored on node 2a6c.
Imagine now that you only know node 7811 and you are looking for the data with the identifier each.
You ask node 7811 for the data each. 7811 doesn't have it so it asks the node e9c3 which sends it to node 7811 which sends it back to you.
A clever algorithm allows finding data in O(log(N)) jumps. Without storing the entire routing table of the network (the addresses of each node). Basically, you ask the closest node to the data identifier you know which itself asks the closest node it knows and so on reducing the size of the jump at each step.
A DHT is very scalable because the data are uniformly distributed among nodes and lookup time generally grows in O(log(N)).
A blockchain is also a distributed data structure but its purpose is completely different.
Think of it as a history, or a ledger. The purpose is to store a continuously-growing list of records without the possibility of tampering and revision.
It is mainly used in the bitcoin currency system for keeping track of transactions. Its property of being tamper-proof lets everybody know the exact balance of an account by knowing its history of transactions.
In a blockchain, each node of the network stores the full data. So it is absolutely not the same idea as the DHT in which data are divided among nodes. Every new entry in the blockchain must be validated by a process called mining whose details are out of the scope of this answer but this process ensures consensus of the data.
The two structures are both distributed data structures but serve different purposes. DHT aims to provide an efficient (in terms of lookup time and storage footprint) structure to divide data on a network and blockchain aims to provide a tamper-proof data structure.
To learn more, join Blockchain Certification today.