It is not possible to parry a sword stroke with a dagger; the difference in inertia is too great. At best, it will end with a hand injury. However it is possible to parry a thrust with one; simply get the blade of the dagger on the foible of the sword. There are two parts of a sword blade; the forte, or strong, near the grip, and the foible, or weak, near the point (the dagger, being so short, can be considered to be all forte). The reason that the foible is weak is because the blade acts as a lever, letting anyone pushing against it control it more easily than the weilder. Anyone who gets his forte on his opponents foible can control the blade. (provided the other doesn't disengage) This can be done with a sword, a dagger, a stick, or even your hand.
In my sword classes we frequently drill with one person unarmed, who's mission is to get in close without getting hit. It can be done, and this is the best strategy for a person with a dagger; tempt the swordsman to attack at a distance that can be avoided, then dart in before he can recover. The trick is that a smart swordsman fighting someone with a shorter weapon will attack immediately as soon as the other is close enough, then take a step back and swing again. This will defeat most attempts.