Under normal circumstances, no, Shedinja cannot learn Swords Dance. So Sep's answer is correct.
But! There is a way. Except it's a very specific glitch. So 99.9% of the time Shedinja can't learn Swords Dance, but technically it can.
The way the glitch works is to have Nincada evolve at Lv. 25. This is the same level that Ninjask learns Swords Dance. If you teach it Swords Dance upon evolving, and have all the necessary conditions for Shedinja to appear, Shedinja will also learn Swords Dance.
The catch is that this glitch only works before Black and White. After that, it does not work and Shedinja can't learn Swords Dance.
In Gen II – IV, it is possible. However, if you plan on using Poké Bank to transfer it to Gen VI, apparently it gets rejected.
"This is what lolnub is talking about. When Nincada evolves to Ninjask, whatever move Ninjask has at the point, Shedinja will have as well. As lolnub used for an example, when Nincada evolves into Ninjask at lvl 25, where Ninjask will learn Sword Dance, so will Shedinja since it will copy Ninjask's moveset."
Source