In the DMG it says
The character must also be a spellcaster with spell slots and must be able to cast any spells that the item can produce.
Many magic items let users cast spells. For example Crystal Ball says
The typical crystal ball, a very rare item, is about 6 inches in diameter. While touching it, you can cast the scrying spell (save DC 17) with it.
It says you can cast the spell. Does that meet the requirements of being able to cast the spell for the purpose of crafting a scroll of that spell?