I think you are asking two questions. First is, How are dendritic segments modeled?
Here is an illustration of an HTM neuron, which is a model of a typical neuron in the neocortex. Dendritic segments are modeled as a small set of synapses plus a threshold. An HTM neuron has numerous dendritic segments. One segment for the "proximal dedrites" (green in figure below), a set of segments for the "basal dendrites" (five of them shown), and a set of segments for the "apical dendrites" (three shown). If the number of active synapses on a segment exceeds the threshold then the segment generates a spike. If the proximal segment exceeds its threshold it leads to an action potential that travels to other neurons. If a basal or apical dendrite segment exceeds its threshold, the dendrite generates an NMDA spike which depolarizes the cell but does not lead to an immediate action potential. In real neurons the interaction between basal and apical dendrites is a bit more complicated. That's how we model dendrites.How synapses are learned is another topic.
Your second question is about the relationship between the two diagrams. The first diagram shows a single dendritic segment forming synapses with neurons in another "pre-synaptic" space. This figure could apply to almost any dendritic segment, although I think in this case it was referring to a proximal dendritic segment. The second figure is illustrating the spatial pooler. The little squares on the right are not neurons or dendrites, but mini-columns. Each mini-column consists of 10 to 30 neurons. Each neuron in a mini-column has the same, or similar, connections between the pre-synaptic input space and the proximal dendrite. In the diagram each square is like the top of a mini-column, the green squares are "active". Because all the cells in the mini-column recognize the same pattern on their proximal dendrites we just say that the mini-column is active. The "spatial pooler" takes an input, and activates a sparse set of mini-columns. The set of active mini-columns represents the input. That is what this figure is showing.
In a leaned context, only one of the cells in a mini-column will actually create an action potential. This way the set of cells takes an input and converts it into an SDR that represents the input in a particular context. I hope that helps.