Usually yes, with the domicile's approval. Regulators license captives against a business plan, and writing coverage for affiliated parties, your customers, contractors, tenants, and employees, is an established part of many approved plans. Domiciles vary in what they permit and what they call it, so the specific program needs regulatory review, but the pattern is common and well worn.
The practical requirements are the ones you would expect of any insurer taking on others' risk: pricing discipline, since the buyers are no longer just yourself; claims handling that treats the affiliated party fairly; and capital sized for the added exposure. Done well, earning underwriting profit on risk you understand better than any commercial carrier could is a major advantage.