The correct option is
B through
The sentence indicates that the river comes in the town from one side and goes out the other. Thus, the river comes from some external location and ends up going to another external location with the town being in its path. The answer must convey the above meaning.
Option A is incorrect. 'in' indicates that the river is running inside the town. It conveys the meaning that the river originates and ends within the town, which is not the case. Thus, it is incorrect.
Option B is correct. 'through' means 'to go in at one end and come out at the other'. Thus, it conveys the meaning that the river's origin and destination is external and the town is just in its path. Thus, it is correct.
Option C is incorrect. 'over' indicates that the river suns above the town and the town is located below the river. This does not make any sense. Thus, it is incorrect.
Option D is incorrect. 'from' indicates that the river originates in the town but has an external destination. That is not the required meaning and thus, it is incorrect.