Yes; darkness targets a point, not an object
From the description of the darkness spell:
Magical darkness spreads from a point you choose within range to fill a 15-foot-radius sphere for the duration. The darkness spreads around corners. A creature with darkvision can't see through this darkness, and nonmagical light can't illuminate it.
If the point you choose is on an object you are holding or one that isn't being worn or carried, the darkness emanates from the object and moves with it. Completely covering the source of the darkness with an opaque object, such as a bowl or a helm, blocks the darkness.
As you can see, darkness does not target the object itself; it targets a point you choose within range, which can be on an object. If you covered the entire object except for that one point, the darkness would still emanate and would not be blocked. On the other hand, if you block that one point on the object, then the darkness is blocked even if you don't block the rest of the object.
In your example: you could cast darkness on a point on the blade of your dagger and then sheathe it, which would block the darkness from emanating from that point until uncovered.
Note that for the second paragraph of the spell description to apply, it has to be a point on either an object you are holding, or an object that isn't being worn or carried. Technically, those parts of the spell would not apply if you cast the spell on any other point.
(To clarify why I say darkness originates from a point on the object rather than the object as a whole: The entire object can't be "a point" that the darkness emanates from. The point of origin of the spell is a single point. If that point is on an object you're holding or an object that's not worn/held, then the point of origin "sticks" to that point on the object - but the entire object can't serve as the spell's single point of origin.)