A Malton father pepper sprayed a man during an argument in the town, a court heard.