The the standard order for correcting your mix is:
0. Have a good song - No point in recording something that isn't very good to start with, right?
1. Be great at performing the song - The best recording is going to be an accurate capture of what your actual performance sounds like. The better you can be in the rehearsal space, the better you'll be in the studio.
2. Have great tone - Again, a good recording is an accurate picture of what's happening when you play your instrument. Get your instrument to sound the best it can in the space you have, and everything afterwards gets easier.
3. Accurately capture the sound of the instrument - What you hear on the tape (or DAW) should be as close to what's happening in the room as possible.
4. Then mix - If you've done the other parts well, getting a passable mix is mostly just a matter of getting everything to the appropriate volume, and you won't need to "fix" anything.
5+ Master, etc. - That's outside of the scope of this.
So if you can't get your overdubs in sync with each other, that means you're failing at step 1.
If your guitar has bad intonation, that means you're failing at step 2.
Practice along with your scratch track until you can get the vocals and the guitar to line up with it perfectly. Get your tone to sound great.
Then record the overdubs (and probably throw out the scratch take)
(Then upload lossless files for us to help you mix: flac or wav or something
)