Let them choose how much they see
Yes, they should be able to skip any dialogue, for those who want that, but that's pretty black and white - it tends to be either skip everything or skip nothing - it's hard or impossible to tell beforehand what would be actual useful or interesting information.
If you instead separate your dialogue into tiers, that could help matters:
- At the "base" tier, you have the core storyline, and a very brief message for optional quests.
- After this, players can either say "Ok" or some variant of "Tell me more" (ideally avoid an actual "tell me more" message, and have something an actual human being would ask in typical conversation).
Stick to the interesting stuff
Some games might have really interesting lore, but then they start telling me about some farmer's wife who went to pick berries last night, but never came home, and how much they love each other, and how faithful she is, and that she always comes home, and it was close to this bandit camp, and he's very worried about her, etc., etc., etc. - at that point I not only stop caring about that specific piece of dialogue, but also all dialogue that game has.
Stick to what's actually interesting, don't just fill pages of text because you feel you need to explain every little thing in detail - a simple "Can you go look for my wife? She went to pick berries by the bandit camp." will do just fine if you don't have much interesting to say about that.
This also applies to your "main" lore - in some cases it might be better to remove some of the less important details in order to have a more concise and digestible story. Although finding a good balance between too few and too many details would probably be a topic all on its own. You can combine this with the point above - letting players choose how much they see.
Split it into byte-sized chunks
Don't try to tell players a giant chunk of your lore all at once.
Let them regularly run into an NPC or book or whatever to give them a little more information.
Also try to stick to things that are actually relevant to what's currently happening.
Do more than text scrolls
A game is not a book.
You'll lose the interest of a lot of players if you expect them to stop the game and just sit there and read for a while. Having a decent voice actor read the dialogue is much, much better, but still doesn't solve the underlying problem.
Instead, show them cut-scenes - well, a game is not a movie either, but a cut-scene is much better than some NPC just standing there talking.
Or have dialogue during gameplay. This can either be a few words here or there, or it can be continuous speaking. Although there are a few caveats:
- Players should actually hear it - in plenty of games the voice-over gets drowned out as soon as action happens.
- Avoid multiple overlapping voice-overs. This should go without saying, but some major releases have managed to get this wrong.
- No conversations here - it breaks immersion if you're going to have a conversation happen in the background when the character you're talking to is nowhere to be seen. It should be closer to someone telling a story.
- Don't distract players - if you're trying to have an elaborate voice-over in the middle of an intense boss battle, that's not going to work (although you can still throw a line here and there). Also don't go to the other extreme and have the players just run with nothing else happening but the voice-over. It should be somewhere in between - some action, but nothing too distracting.
- Have an NPC keep talking - this isn't a caveat, but rather an idea - when you start talking to an NPC, they will keep talking even if you run away. Be sure to keep in mind the caveats mentioned though (especially "no conversations").
- Allow players to dismiss it, and disable it - if some dialogue is getting distracting, players should be able to stop it, and you should have an option so players who don't want to hear it don't have to stop every dialogue.
One can tell an entire story using one or two sentences on every item, and players would feel kind of part of the story if they know this blade they're using belonged to that great warlord you told them about.
And maybe the item itself has an effect corresponding to what you said about that character.
It's about the game world, too
Yes, your lore might be interesting, but it'll probably be quickly forgotten if the lore seems disconnected from the gameplay.
If, instead, the lore tells of this character who was in a war where he got his leg injured, and, when seeing this character, you can see the scar, they walk with a limp, and maybe this information is incorporated into a boss-fight with that character in some way, that's going to be much more memorable.
Or if you speak of a past civilization, and you could be cool to find some of their artifacts, some glyphs on walls, one of their cities, one of the last remaining members, etc.
Or the lore speaks of a great battle, and later you get to visit the site of the battle.
You could also have what you do affect the world - maybe you go back to a village after doing some quests for them, and you actually see the longer-term effects of what you did - maybe you find the villagers going further out into the forest after defeating the bandits.
The most important aspect here is perhaps the effects of your overarching plot on the game world - if your story is about overthrowing some ruthless evil ruler, that wouldn't be very convincing if everyone you run into is just going about their day-to-day life, everything just looks "normal" and the quests are unrelated to this. It would be much more convincing if you constantly run into this ruler's soldiers, and especially find them tormenting the innocent, if you find some villages burnt to the ground and if the quests generally come about as a result of what the ruler did - either somewhat directly (kill some soldiers occupying a city) or indirectly (kill some bandits, which the villagers can't do themselves because the ruler enlisted or killed all able-bodied men in that village).
You can't keep everyone interested
You just can't, some just care about the gameplay and that's okay.