Given a family $${\mathcal {Z}}=\{\Vert \cdot \Vert _{Z_Q}\}$$
Z
=
{
‖
·
‖
Z
Q
}
of norms or quasi-norms with uniformly bounded triangle inequality constants, where each Q is a cube in $${\mathbb {R}}^n$$
R
n
, we provide an abstract estimate of the form $$\begin{aligned} \Vert f-f_{Q,\mu }\Vert _{Z_Q}\le c(\mu )\psi ({\mathcal {Z}})\Vert f\Vert _{\mathrm {BMO}(\mathrm {d}\mu )} \end{aligned}$$
‖
f
-
f
Q
,
μ
‖
Z
Q
≤
c
(
μ
)
ψ
(
Z
)
‖
f
‖
BMO
(
d
μ
)
for every function $$f\in \mathrm {BMO}(\mathrm {d}\mu )$$
f
∈
BMO
(
d
μ
)
, where $$\mu $$
μ
is a doubling measure in $${\mathbb {R}}^n$$
R
n
and $$c(\mu )$$
c
(
μ
)
and $$\psi ({\mathcal {Z}})$$
ψ
(
Z
)
are positive constants depending on $$\mu $$
μ
and $${\mathcal {Z}}$$
Z
, respectively. That abstract scheme allows us to recover the sharp estimate $$\begin{aligned} \Vert f-f_{Q,\mu }\Vert _{L^p \left( Q,\frac{\mathrm {d}\mu (x)}{\mu (Q)}\right) }\le c(\mu )p\Vert f\Vert _{\mathrm {BMO}(\mathrm {d}\mu )}, \qquad p\ge 1 \end{aligned}$$
‖
f
-
f
Q
,
μ
‖
L
p
Q
,
d
μ
(
x
)
μ
(
Q
)
≤
c
(
μ
)
p
‖
f
‖
BMO
(
d
μ
)
,
p
≥
1
for every cube Q and every $$f\in \mathrm {BMO}(\mathrm {d}\mu )$$
f
∈
BMO
(
d
μ
)
, which is known to be equivalent to the John–Nirenberg inequality, and also enables us to obtain quantitative counterparts when $$L^p$$
L
p
is replaced by suitable strong and weak Orlicz spaces and $$L^{p(\cdot )}$$
L
p
(
·
)
spaces. Besides the aforementioned results we also generalize [(Ombrosi in Isr J Math 238:571-591, 2020), Theorem 1.2] to the setting of doubling measures and obtain a new characterization of Muckenhoupt’s $$A_\infty $$
A
∞
weights.