How to line up (x,y) print area between hardware and software?
The problem you are experiencing is because the position where the y endstop is triggered does not correspond to y = 0, but perhaps corresponds to y = 15 (replace 15 by the offset you're seeing). You can perhaps solve this by adjusting the endstop to trigger at the correct point, but you can also adjust this behavior in software: In your start G-code, after the homing (G28) command, insert a G92 Y15 to tell the printer that the current position (reached after homing) is actually y = 15.

Another option is to use the M206 command to permanently store the offset in EEPROM (rather than needing to provide it in the start code each time).

If your printer moves towards max rather than min, the same applies, but consider that the offset may be caused by the bed size defined in your firmware not corresponding to the bed size set in your slicer.