If you don't have sedation done for the root canal then it will be perfectly fine to drive after having the root canal done.
If you had the dentist sedate you before the root canal then you should have someone else drive you home and do any driving for at least 24 hours after the root canal.
After sedation you could be still drowsy for awhile and it would be unsafe to drive for at least the 24 hours because you could drift off and wreck your vehicle.
But some people have the root canals done without sedation and the dentist will likely just use a numbing agent to numb your mouth.
If it's just the numbing agent to numb the feeling in your mouth then it would be okay to drive after having the root canal done.