From a sociological perspective deviance has to be viewed within the social or cultural norms of the society in which it occurs (without sounding too relativistic). Irving Goffman wrote that everyone in society is deviant by some measure because none of us entirely fit the mold of what is deemed 'the ideal'.
Of course, before Goffman, there was Durkheim, who wrote in the Rules of Sociological Method in 1895, " Imagine a society of saints, a perfect cloister of exemplary individuals. Crimes, properly so called, will there be unknown; but faults which appear venial to the layman will create there the same scandal that the ordinary offense does in ordinary consciousnesses. If, then, this society has the power to judge and punish, it will define these acts as criminal and will treat them as such."
That's right. Then we have the 'positivist' approaches of Parsons (very influential in the U.S.A) and Merton's take on Durkheim's anomie. Then the Marxian oppositions to Parsons in particular, with the emphasis on 'deviance' and social control.
As Harry Freemantle notes, there are potentially numerous answers. See also, within criminology, the harms based approach (e.g., Hillyard and Tombs), but also the work of Richard Quinney in his book, The Social Reality of Crime (1970), which helped to broaden the approach to the definition of crime. And, I'll throw in my own book as a more recent example:
Lynch, Michael, Paul Stretesky, and Michael Long. (2016). Defining crime: A critique of the concept and its implication. Springer.