Not strictly RAW...
Thematically, crafting requires the crafter to have an intimate understanding of the magic they are applying. So only someone who knows the spell well enough to be able to cast it can craft with it, and of course the only people who know spells well enough to cast them are (surprise!) the people who are capable of casting them. This is represented in-game by spells slots.
So someone who has a magic item or natural ability to produce the effect of a spell without a spell slot, does not necessarily understand the spell well enough to craft with it. Being a Planetar or owning a ring of spell storing with Blade Barrier in it will both let you cast Blade Barrier, but in neither case do you really understand the spell.
However, as @screamline notes, this understanding can instead be covered by a relevant skill, which again implies a certain level of knowledge in the crafter. I don't think it would be unreasonable for a DM to rule that magic initiate implies enough knowledge of the spell to craft with it, but it's not quite RAW on it's own. The question is, does Magic Initiate mean you have developer a (super)natural casting ability (like a Planetar), or does it mean you have intensively studied just that one spell until you have the knowledge to cast (and craft) it?
End of the day, if you want to allow the fighter to craft, you need to either give them something else (i.e. a multiclass, or a feat that grants slots, or the arcane proficiency with XGtE variant, etc), or use DM prerogative to tweak the rules a little bit.