Bandmath with vector

How is it possible to do band maths using a vector e.g. replace values of a raster based on where vector is?

for example, you can define an expression like the following:
if(vector1) then B2 else B3

Yes you can. It is quite useful to mask areas based on a polygon you drew

Just use it as a band in the BandMath