It is very unlikely that any of the good folk used advanced siege machinery.
In the books, there is little to no description of what a siege is in Tolkien's world. Even with Angband or Mordor's siege, there is little more than mentions of "bolts". The only time the words "catapult" or "ram" come into play is for Gondor's siege, and it was laid by Sauron.
In his numerous depictions of good versus evil, it is indeed the bad guys who tend to use technology for war and domination. Most of the good folk, even dwarves, use their skills for creation, not destruction.
There is actually a very good reason in-universe for this: the old builders made almost invincible fortresses.
Dwarves were safe from siege weapons inside the mountains. The enemy have to dig their own tunnels, break the door or find some hidden passages to hope for any invasion.
The old Númenóreans were mighty builders, as their legacies stand proof: first quote is from Pippin, when narrating the Ent siege of Orthanc, second is before Sauron's catapults fired their wicked explosive projectiles.
(Pippin) Many of the Ents were hurling themselves against the Orthanc-rock; but that defeated them. It is very smooth and hard. Some wizardry is in it, perhaps, older and stronger than Saruman’s. Anyway they could not get a grip on it, or make a crack in it; and they were bruising and wounding themselves against it.
LotR, The Two Towers, ch. 9: "Flotsam and Jetsam"
At first men laughed and did not greatly fear such devices. For the main wall of the City was of great height and marvellous thickness, built ere the power and craft of Númenor waned in exile; and its outward face was like to the Tower of Orthanc, hard and dark and smooth, unconquerable by steel or fire, unbreakable except by some convulsion that would rend the very earth on which it stood.
LotR, The Return of the King, ch. 4: "The Siege of Gondor"
As for the Elves, most of them relied on subtlety and magic. Lorien's forest wasn't protected with stone walls; and before Doriath, the kingdom of Thingol, had some kind of magical mazes made by Melian, to protect themselves from the dark rule of Morgoth.
So what was the plan of "good folk" when laying siege to evil fortresses?
The answer is hunger:
But some answered: ‘While we yet live? How long? He has a weapon that has brought low many strong places since the world began. Hunger. The roads are cut. Rohan will not come.’
LotR, The Return of the King, ch. 4: "The Siege of Gondor"
As for your remaining question, I would say that the explosives were not entirely unheard of for anyone that studied military lore against Sauron.
Not only does Aragorn shout "Devilry of Saruman", he also points out that "[the orcs] have lit the fire of Orthanc beneath our feet". Such explicit naming undoubtedly means he's well aware of Saruman's trickery and where they come from originally.
Additionally, it can be noted that there is some reference to "a fire" for Morgoth's army:
Many now fled to the Havens and took refuge behind Cirdan's walls, and the mariners passed up and down the coast and harried the enemy with swift landings. But in the next year, ere the winter was come, Morgoth sent great strength over Hithlum and Nevrast, and they came down the rivers Brithon and Nenning and ravaged all the Falas, and besieged the walls of Brithombar and Eglarest. Smiths and miners and makers of fire they brought with them, and they set up great engines; and valiantly though they were resisted they broke the walls at last.
*The Silmarillion *, ch. 20