OBS doesn't currently have any way to undo. The red frame is the border around your source. Each source can be moved independently, and sources snap to the edges of the canvas. You can right click the source and select Transform to choose predefined positions, or use Edit Transform... to set the pixel position manually.