Agreed that it is supported and possible from a browser and CSS perspective. What's missing in the case of phpBB's
BBCode -- but what all those other examples you cited do
have -- is a specific HTML tag that is encapsulating each line of the output. In your successful examples, the CSS numbering was simply attached to whatever that HTML element was; <span> in one case, and <code> in the other case.
But the phpBB
BBCode implementation doesn't already inherently "wrap every line in a specific HTML tag", such that you could apply CSS counting "to an HTML element that appears on every line." The phpBB
BBCode implementation simply emits the "raw" input, which when wrapped in a <pre> tag, causes the web browser itself to honor whatever line endings and other whitespace are present. There is no "per line HTML tag" for you to attach CSS numbering to in that scenario, which is why the attempts to make a CSS-only change have failed.
BBCode perform numbering is going to involve further transforming that "raw" input phpBB is otherwise designed to emit; such that the output within the <pre> tag will now also have a specific HTML tag encapsulating each individual line. At which point you will be able to attach CSS numbering to whatever that added HTML tag is.