Yes, you can use it if you're careful about the material and the purpose. Graphite, itself, can be purchased virtually pure. It's available in different particle sizes, but the typical graphite powder used for purposes like lubrication is also fine for art purposes.
You need to distinguish between pure graphite and graphite-based materials. Graphite-based materials sold for one purpose may not work well for a different purpose because the material is a mix of graphite and other stuff designed to optimize the mixture for a specific purpose. So, for example, dry graphite lubricant powder may have other materials in it that will interfere with the properties you want to use it for. Look for material described as pure graphite.
The product description will often include uses the powder is suitable for based on its particle size and purity. For example, this product from Amazon describes that it is suitable as a lubricant and a pigment for resins, so I would expect it to be generally fine for other art purposes (although you may need to mix it with other ingredients for some purposes).
As far as safety, graphite powder in a particle size used for art is extremely fine stuff that easily gets suspended in the air. You don't want to breathe the dust because it can be harmful to your lungs (and what gets into the air will eventually settle on surfaces and make a mess). You should at least wear a good dust mask or N95 mask, and it wouldn't hurt to set up a HEPA filter, or vacuum cleaner with a HEPA bag, to draw in and filter the air in the area where you work with the loose powder.