I think the answer is no, because "all locally ringed spaces" is a really broad assortment of objects - it contains too many different types of things for only one concept to really get everything done. This isn't really a proof, though, just an explanation of how most common options do not work. (If you can come up with some axioms you'd want dimension to satisfy, perhaps you can edit them in to your post and we'll see about getting a real proof together.)

Purely algebraic notions defined only in terms of data from the local rings can't be compatible with our topological expectations: given any local ring $R$, the one-point space with $R$ as its sheaf of rings gives a locally ringed space. In any morally upright notion of dimension, this space would have dimension zero: it's a point! But this means that any invariant of local rings you pick to give "dimension" should return zero on all local rings, which isn't great.

Purely topological notions don't work across all of things that can be considered locally ringed spaces either. Krull dimension doesn't work for Hausdorff spaces as every irreducible closed set is a singleton, so we always get dimension 0. All the usual notions of topological dimension (Lebesgue covering, small inductive, large inductive) all fail on schemes with a single closed point because any open cover of such a scheme must contain the whole space. This immediately implies that any such notion of dimension must return zero.