I know this is about a week old now but I think I know what your problem might be.
First, remember that the view that you are setting to 1280x1024 specifies the co-ordinate system within the window, whatever size that window might be.
You don't actually change the view, it seems.
Note that resizing a window does not change its view; that means there is no reason to set the view to the same one again when the window was resized.
Also, I don't understand why you created an instance of sf::Mouse
Anyway, you
do get the mouse position of the window perfectly fine and you
do then map the pixel location to co-ordinates perfectly well. However, you then pass the
pixel location to the draw the dot, which, for some reason, you 'get' again.
Actually, since you're using events, the mouse's pixel location is already contained in the MouseButtonPressed event! You just need to map it as vector:
const sf::Vector2f mousePosition = window.mapPixelToCoords(sf::Vector2i(event.mouseButton.x, event.mouseButton.y));
(instead of "dotPosition = static_cast<sf::Vector2f>(mouse.getPosition(window));")
This is the position you want to pass instead of "dotPosition".
If you
do change the view, make sure that you are mapping using the correct view. As it is, though, your view is static so this is fine.
IMPORTANT: do not forget that the update of the window should be done regardless of if there are events so the clear/draw/display section should not be in the event loop.