The correct option is
B for
The above paragraph has use of many prepositions. 'For' is the correct preposition to be used in the sentence - They felt pity for the beggar. For is used for many purposes but here for is used in sense of concerning for somebody/something.
'Of' is used for belonging to, relating to, or connected with somebody or some place.
'On' is used to express a surface of something.
'With' is used to signify being together or being involved.
'In' is used to signify a location or place.
'To' is used to link ideas.
Thus, the paragraph would become:
Long ago, there was a blind beggar in Vienna. Every evening, he stood on the street and began singing and playing the violin. His dog sat with him. It held a cap in its mouth. People enjoyed listening to the music. They felt pity for the beggar and dropped coins in the cap. Hence, for this question the correct answer would be option A.