If it is only scale then just transform the mouse by the same.
mouse.x = ?
mouse.y = ?
var scalex = -1;
var scaley = -1;
mouse.tx = mouse.x * scalex;
mouse.ty = mouse.y * scaley;
But I am guessing you also move the image you are drawing so you can see it.
So you may have done something like
var drawImage(image,-200,-200); // move image back onto the canvas
You will have to do the same to the mouse (scale and translate). When you do the reverse of a transform you do it reverse direction. So when you scale then translate, you invert it by translating, then scale.
var box = { // a hit region in normal screen coordinates.
x : 20,
y : 20,
w : 60,
h : 60,
}
// the mouse
mouse.x = ?
mouse.y = ?
// the scale on translations so you can see the box
var scalex = -1;
var scaley = -1;
var originx = -200;
var originy = -200;
// transform the mouse screen coords into transformed canvas space
mouse.tx = mouse.x + orginx; // translate first
mouse.ty = mouse.y + orginy;
mouse.tx *= scalex; // then scale
mouse.ty *= scaley;
// draw the transformed image/box/whatever
ctx.scale(scalex,scaley);
ctx.translate(originx,originy);
ctx.strokeRect(box.x,box.y,box.w,box.h); // draw the back to front box
// is the mouse over the hit region and hence the box
if(mouse.tx > box.x && mouse.tx < box.x + box.w && mouse.ty > box.y && mouse.ty < box.y + box.h){
ctx.fillStyle = "red"
ctx.fillRect(box.x,box.y,box.w,box.h);
}
That is the simple version that only has scale and translate and will work for all scales and translations as long as you do not rotate it. If you rotate you need to do the full inversion. You can find how to do that at this question HTML Canvas, mouse position after scale and translate