Literary? Tolkien said that his dwarves were inspired by the Jews, if anybody, and he was the first major author to associate dwarves with mining and living underground. The legends which influenced Tolkien were mostly German, Nordic and Anglo Saxon, not Scottish.
Dwarves were good smiths and many of them lived underground in later Norse mythology, which specifically describes them. [
1] [
2] [
3]
From the
Prose Edda:
In the later popular belief, the dwarfs are generally called the
subterraneans, the brown men in the moor, etc.
But the following are also dwarfs and dwell in the rocks, while the
above-named dwell in the mould:
Too late do you offer to make
peace with me, for now I have drawn the sword Dainsleif, which was
smithied by the dwarfs, and must be the death of a man whenever it is
drawn; its blows never miss the mark, and the wounds made by it never
heal.
Unless you want to make the argument that many of them lived underground, were good smiths, yet imported all of their metal for mysterious reasons (rather than simply digging more). Interestingly, dwarven drink is also mentioned in the Prose Edda, suggesting that dwarven alcoholism isn't entirely a modern invention. The dwarves of later norse mythology in many ways greatly resemble our modern trope.
As for Tolkien, it seems that the only connection he ever explicitly stated was a linguistic one, although obvious analogies can be made in the specific case of The Hobbit. The source for people talking about Tolkien's dwarves and Judaism (just one paragraph in an interview):
I didn’t intend it, but when you’ve got these people on your hands, you’ve got to make them different, haven’t you?” said Tolkien during the 1971 interview. “The dwarves of course are quite obviously, wouldn’t you say that in many ways they remind you of the Jews? Their words are Semitic, obviously, constructed to be Semitic. The hobbits are just rustic English people.
He prefaces by saying that he didn't intend a connection, and then states that their words are Semitic. It's really a large stretch to take this paragraph and imply that Tolkien's dwarfs were "inspired by jews", especially given how similar to Norse dwarfs they are, and his prefacing sentence refuting this idea. Not to mention that the man "intensely disliked allegories", and took care to specifically refute most claims of allegorical inspiration in his works.