They are most often synonyms.
The idioms "scraping by" (barely surviving) and "in a scrape" (in a predicament, trouble) cannot substitute "scratch" however.
The idioms "up to scratch" (adequate) "from scratch" (using original ingredients rather than a prepared mix) cannot substitute "scrape" however.
Similarly, "scratch paper" (extra paper for quick notes) is unique.
Student or Learner