Typically, yes. 

Whether it’s made of alloy or steel, bike forks are designed for severe working conditions. They’re prepared for road shocks and hard braking. The amount of stress from motor axle torque is negligible compared to other loading scenarios. However, it’s your responsibility to inspect the fork and headset for any crack or defect to prevent risk of failure.