A project to reconcile Jesus' teachings regarding self-defense bears an immediate problem that the teachings aren't about self-defense.
Hypothetically (but patently) English situates self-defense into speakers' popular hotch-potch conception of oriental philosophy. So it's familiar cliche for martial arts to be taught in terms of balancing an opponent's energy. "Chi" is in popular usage but the 'I Ching' isn't on bookshelves.
====
μὴ ἑαυτοὺς ἐκδικοῦντες, ἀγαπητοί, ἀλλὰ δότε τόπον τῇ ὀργῇ· γέγραπται γάρ “Ἐμοὶ ἐκδίκησις, ἐγὼ ἀνταποδώσω, λέγει Κύριος.”
====
The OP's question might be approached at a Word Study level by asking if ἐκδίκησις=Vengeance corresponds productively with our idea of 'Self Defense'.
Straightaway, by its parts an ἐκδίκησις is an out-judge-ing. And if it is God's it might be don't hit people back because I'll judge you... which in English technical-legal language is more like "I have jurisdiction".
Very different from don't hit people back because it's my job to hit them.
And that highlights that a converse is being taken from Ἐμοὶ ἐκδίκησις . God is talking about what we can do, but we are reading it as a statement about what God can do.
The place he says it is Deuteronomy 32:35, and we need to be prepared for the likelihood that Paul is quoting a Greek translation from Hebrew, and that therefore there's a question how much he intends to bring over from the Hebrew word.
ἐν ἡμέρᾳ ἐκδικήσεως ἀνταποδώσω = Vengeance is mine, and recompense
Matching Paul's “Ἐμοὶ ἐκδίκησις, ἐγὼ ἀνταποδώσω.
So the question is open.
The Hebrew word ἐκδικήσεως translated was נָקָם֙
https://biblehub.com/hebrew/5358.htm
Looking at Strongs and Brown-Driver-Briggs, this is an emphatic word used for God's punishment of those who breach the covenant, avenging murder and spilt blood. This might be why our translations leave behind the legal senses of ἐκδίκησις - those are brought in by the Greek.
To check this, we can at this late point come back to a Greek lexicon. Liddell & Scott has edikazo of a judge finally settling a lawsuit (Aristophanes Knights, 50) and the other examples are all technical-legal.
ἐκδικέω might be a bit more emphatic/less legal. There's avenge/punish a crime. Most of the examples are LXX or NT. Luke uses it of specifically legal protection at Luke 18:3-5.
ἐκδίκησις the noun - 'an avenging' / to give satisfaction. But see Polybius 3.8.10
δόγματι μόνον τὴν ἐκδίκησιν ποιησαμένους = = [The Carthaginians could have ensured their safety] by merely passing a decree.
===
Usually a lexicon entry carries more weight than an argument from etymology, but I submit that for this word there are too few surviving examples and the LXX's translators having adopted it for Hebrew nā-qām has created something of a circularity whereby we now can't tell what they intended by doing so.
The root -δίκ- emphasizes jurisdiction, which the LXX's translators might perhaps have found in nā-qām (or they may have wanted to add it for theological reasons we can't tell). English translators have a dilemma: the fact we can't detect any judicial sense in nā-qām isn't sufficient to remove that sense from the translation of ἐκδίκησις.
For nā-qām Strongs only has 17 occurrences, nearly all of which are reserved to a just God.
If it stands, that's a nice condundrum: Vengeance is God's, and so emphatically so that we mortals can't even tell what it is. [humour] Perhaps it is a sort of nice cake [/humour]
What can be said from the remaining 17 occurrences is it's used about murder and in military contexts. It's not the liquidated damages on the back of Solomon's bills-of-lading for timber. It's not Mr. Wilson getting his apples back.
It can be malicious (Ezekiel 25:15) and the same place suggests there can be ἐκδίκησις and counter-ἐκδίκησις.
== == == == == == == ==
A hotch-potch conception of oriental philosophy might help us though. It's often conjectured many ideas moved up and down the spice roads in long-lost antiquity and crop up again in the oddest places.
Self-defense isn't vengeance. It's not "If you kill my dog, I'ma slay your cat" or "Judas fought against the children of Esau in Idumea at Arabattine, because they besieged Gael". That destructive, worst-case, eye-for-an-eye retribution might be what God's reserving to himself in Deuteronomy. We might not gain a precise weighting of how much blood must be in the scale, or whether grievous bodily harm is in there as well as murder - but God or just our text doesn't have to delineate what's reserved to him for the reason it's beyond us.
Paul's usage in Romans 12 isn't in an immediate or Old Testament type context of military reprisals or punishment-killings. But if he's anticipating that these matters will be absolutely mortal for himself, and eventually many in his immediate audience, we know with hindsight he was absolutely right.
If we are fortunate enough to live in the countries where Christianity isn't punishable by death or subject to severe and government-condoned persecution, then what we should derive from that is a pastoral question.
If Paul can tell his followers not to retaliate against his, or their own, killers, we can say that speaks to what we should do about that menacing kid next door, or Terminator X's household pets. But that is by hyperbole on our part and we should remember the advice is still very direct to many Christians.
========================================================
Matthew 5:38-40 is being brought into juxtaposition with Romans 12. But I'll contend it's most useful because of this exact point of scale.
Jesus is quoting Exodus 21:23–27 : עַיִן תַּחַת עַיִן, = = [only] one eye for one eye
Which of course is a proposition he believes. And one reason he can believe it, side-by-side with his contention here "Do not resist the one who is evil." is that the emphasis wasn't on cruel and unusual forms of corporal punishment, but on commensuracy. Which can be seen in God's 'vengeance' at the scale above us. (in that nā-qām isn't for Philistine cities being laid waste because someone there ate a wrong meat or shaved in the wrong direction). And in our own time, and probably any other, proportionality and measuredness are not a universal default setting of humanity's.
Jesus qualifies "Do not resist the one who is evil." with the examples of someone hitting us, someone stealing our cloak, someone making us walk too far, and someone asking to borrow money.
And that fits neatly underneath the scale offered by Exodus (grievous bodily harm) and underneath the scale offered by Deuteronomy (blood-retaliation at the level of nation-states). It looks like an expository division-into-three.
The trivial - we prosecute - smaller than the human scale - money
The criminal - the courts prosecute - equal to the human scale - blood
The transcendental - God prosecutes - larger than the human scale - life
At each of these levels, by Jesus' addition, the scripture now has worked examples following a consistent principle: commensuracy.
There can be derived a further principle: of supervision or oversight. Which also finds expression in both ancient and modern jurisprudence. Courts have levels at which they can try things, and we are a court too. For those ideas elsewhere in scripture there's "lex dei in corde ipsius" in the Psalms, being the spokesperson of (God as the true) judge involves a duplication of the law into the human heart. And the parable of the talents - each of the servants is given a jurisdiction proportionate to the justice they have inside them.
More tentatively, if we find some asceticism in Jesus' other teachings on money, he might here be doing something along the lines of demoting financial disputes into the trivial, whilst holding that the courts (who we know will kill him) ought to refer up to God when a matter escalates from bloodshed (such as eyes and teeth) to the spilling of human life (=nephesh).
There are other places in the scripture where this hypothesis might be tested, such as the woman caught in adultery: is that reserving the death penalty to God distinct from disapplying it. But it would too much divert from the OP's question to explore that.
======================
Something which literature, the texts, and finally our readings - sadly lose is colloquialism. The 4 examples Jesus offers are markedly everyday and if they have a converse (which we can extract exegetically) that supplies a "nice" bit of folk-wisdom, that's to be noted, at least in case it turns up on a scroll somewhere.
The other cheek: ἄλλην σιαγόνα.
ἄλλος is straightforward and our idiom is still close enough: another of similar type. So with definite article we take it as "the other" but English idiom forces the definite and the indefinite into marked distinction. τὴν ἄλλην also needs to distinguish our other cheek from someone else's cheek . But this never confused anyone.
σιαγών is really the jaw-bone, which English treats as singular. We're here in a contrast between τὴν δεξιὰν... τὴν ἄλλην. So to create the to-us simple image, the Greek might have needed to turn a monistic jawbone into a pair of dualistic cheeks. Let's check this.
Big Liddell & Scott (1882) has not many examples but there is Aristotle P.A.3.7.4. That's now a broken citation and De Partibus Animalium isn't on Perseus Project and the scanned versions on Archive.org have broken OCR meaning the text isn't searchable. But we've got... of Crocodiles "το την σιαγόνα" jaw (II.7, around 660a26) is singular but as we'll see for this species he might be talking about one jaw of two. "τας σιαγόνας" man and quadrupeds move their jaws up and down - that will be multiple species each of whose jaws is here in the plural. 658b30 is better "eis stenon tas diagonas"=those animals whose jaws project forward and become gradually narrower. Also the crocodile "κινειν σιαγόνα η την κάτωθεν αύτό" moves the upper jaw instead of the lower one - [humour] Aristotle is super interested in why crocodiles' have their jaws the wrong way round [/humour] This suggests the word refers more to the upper and lower jaw than the left and right cheek.
Aristotle might be using words in technical anatomical/medical senses, but he's still on the bookshelves in Matthew's time. For him the jaw seems to be internal and mechanical. Creatures have two of them: an upper and a lower one. So by a small extension the singular marks out the upper or the lower or (as here) the left or the right, but in the absence of that qualifier, our jaws (and therefore in translation our cheeks) are plural.
Jaws. I've got two of them. From this:-
Simplex: If you hit my right one, you can have the other.
Converse: I've only got two, so if you hit the other one as well, that's your lot.
This is why Jesus doesn't just make the sweeping, didactic statement "Do not resist the one who is evil." and leave it at that. It requires qualification.
By qualifying it with the cheeks, he brings in a folksy "fool-me-once" sentiment. We can't tell if it's a popular aphorism. But it sets an immediate and clear route of escalation from what I have proposed is the trivial court, in which we are our own judges, to the criminal one in which the judges are the judges. God's law is not diminished in the courts of the trivial and criminal, but fully-revealed in microcosm.
I contend that what the scripture prescribes for the good man, and what it clarifies by this reference to "the other cheek", isn't boundless masochism, or tolerance-in-absurdum, but the humble adoption of God's law into his heart, and the recognition of when a dispute requires escalation to a higher judge.