A DMM measures resistance by outputting power with a fixed, known quantity (either current or voltage, i don’t know which) and then measuring the resulting voltage (if current is fixed) or current (if voltage is fixed) in the component, and the resistance of the component is calculated from the two values using Ohms law.
This only works on passive components, it can’t work on a component which introduces it’s own power into the circuit, such as a battery, and connecting a battery to the DMM’s resistance measuring circuit which is not meant to take power input may have consequences.
Hopefully your DMM has built in protection to prevent damage from such a connection.
The internal resistance of a battery can be determined using a DMM and a resistor of known value (with correct power handling capabilities for the power that would be delivered to it), known as a ‘shunt resistor’.
The battery’s voltage both with and without the shunt resistor connected across the battery is measured, and as the difference between the two voltages is be due to battery’s internal resistance this can be calculated with a formula derived from Ohms law.
There are caveats to ensuring as accurate a value as possible, HKJ’s article here contains detailed info on the above, including the formula:
https://lygte-info.dk/info/Internal impedance UK.html
There is also a thread here which shows thefreeman’s solution to making 4 connections to the battery: https://budgetlightforum.com/t/measuring-battery-internal-resistance-always-around-50-60-mohms/65680/7