The N.E.D. refers this to the German Autsch, a cry of pain, and gives a Pennsylvania example, 1886. It may have come across with the Dunkers or the Mennonites.

1

1837.  “Ouch!” shrieked Dabbs; “my eye, how it hurts! Don’t him me again.”—J. C. Neal, ‘Charcoal Sketches,’ p. 38.

2

1837.  “Ouch!” ejaculated a voice from the interior, the word being one not to be found in the dictionaries, but which, in common parlance, means that a sensation too acute to be agreeable has been excited.—Id., p. 220.

3

1845.  “Ouch! whew! man alive! what’s that?” shouted the speaker, and he lifted his feet from under him so suddenly, that he came near pitching on the floor.—W. T. Thompson, ‘Chronicles of Pineville,’ p. 49 (Phila.).

4

1850.  I want a tooth pulled, can you manage the job? Ouch! criminy, but it hurts!—H. C. Lewis (‘Madison Tensas’), ‘Odd Leaves,’ p. 82 (Phila.).

5

1856.  

        ‘Owch!’ an awkward darkey’s basket
  Hit him a thump in the eye,
And stars are flashing before him,
  Like the orbs in a wintry sky.
Knick. Mag., xlviii. 546 (Nov.).    

6

*** Compare the following quotation from the N.E.D.:
  1654.  But harke Sancho Pancas runs ouching around the mountains like a ranck-Asse, braying for’s Company.—Gayton, ‘Pleasant Notes,’ iv. 176.

7