matches invented 1826, and lighter invented 1823.
Kinda seems like the joke form Hitchhiker's Guide about inventing aerosol deodorant before the wheel.
Part of the issue here is when naming what was the "first" appearance of a technology, even defining what counts can be fuzzy. It sounds like when you are using the word "matches" you are referring to friction matches, and when you are using the term "first lighter" you are meaning a Döbereiner Lamp. In that case while both dates are correct, but when presented as raw trivia without context the situation is deceptive.
Let's set, first, as a ground rule, that we're wanting things that are self-igniting. This excludes some earlier items; the article The Earliest Matches, for instance, uses the term "matches" to describe neolithic cylinders that are applied in combination with fire boards (where the rotation causes sparks). The term "matches" also gets applied to pine sticks from 6th century China dipped into sulfur. Yes, the sulfur made the sticks easier to light, but they still needed a to get started the old fashioned way (via flint, rubbing, using an already-lit fire, etc.) One could in a sense call them matches but it is highly deceptive to compare them to modern friction matches.
Even then, still, you can get a bit earlier than the 19th century. The pyrophorus was a glass with powder that ignited spontaneously on contact with air upon breaking; roughly in 1680, the German Wilhelm Homberg was doing experiments attempting to turn mercury into silver via "odorless white oil" extracted from human excrement (this was when alchemy and chemistry were still cross-over disciplines). He found that, while combining the excrement with potassium alum, that when exposed to air the residue caught fire. He resulted in his designing a mixture with alum, honey, flour, and sugar; when combined with cotton it would set fire. This is one of the earliest cases of trying to design a purely chemical reaction; the ideal of sealed chemicals intended for ignition was maintained through the 19th century, including one a 1865 patent for a substance meant to be sprinkled in a pipe and ignited by the user sucking on it.
This sort of experimentation was carried over to the Döbereiner lamp from 1823. Döbereiner was a German chemist whose more long-lasting legacy was finding so-called "Döbereiner triads" which were patterns of elements that were sort of a proto-version of the modern periodic table. For our story here, he found that a sponge of platinum (made from ammonium chloroplatinate) combined with hydrogen would make a flame. The full lamp design combined zinc with sulfuric acid to make hydrogen (that is, Zn + H_2 S O_4 causes the hydrogen to separate) which was then opened via a stopcock to be shot at the platinum sponge. Is this a "lighter"? There's no friction wheel for creating a spark: it's just a raw chemical combination. I would say the designation as "lighter" is done ahistorically after the fact, to try to trace some sort of family resemblance but not being the same thing in modern terms.
Döbereiner lamps did see use all the way through the 19th century, but if we just consider matches to be self-lighting sticks of sorts, matches did come a bit sooner: in 1805 with Jean Chancel which made a combination including potassium chlorate and sulfur which could ignite dipped into sulfuric acid. This was dangerous and not terribly practical.
John Walker in England developed a friction match in 1826 (here's the date you're thinking of) and made what he called "Friction Lights" using the same concept as before but with different ingredients (using antimony trisulphine instead of just sulfur) with the crucial addition of not needing acid. They were lit by rubbing sandpaper; they started getting sold in earnest starting in 1827. There was still serious problems with safety, and early friction matches could have the tip rub off while trying to light them. In the best case the tip would fall off before igniting, and in the worst case it would case a fireball to fly away.
This was essentially more an engineering problem than a chemistry problem and subsequent matches by other inventors addressed the issue. The matches also lacked phosphorous which started to get introduced in 1830 with a design by a French chemist (Charles Sauria), and that is where matches started to genuinely seem like their current form. (For a while, Sauria was the one who got credit as the true inventor of the match; there are likely books out there that still make this claim.)
To summarize, yes, relying more heavily on chemistry and no spark, it was easier to combine two substances and cause ignition than it was to combine a substance and friction; essentially, the latter required a relatively safe, inert substance, something that could be used more freely than acid, even if you still had to worry about lighting the carpet on fire. If you consider "matches" to be allowed to be just the stick with a chemical reaction and no use of friction, then they did get invented before the so-called "lighter".