You can potty train a child why they are still sleeping in a crib but it can be harder for the child to be able to go potty.
Since the child can have a hard time getting out of the crib on their own to go to the toilet it can be difficult for the child to grasp potty training or get to the potty on time if they are in the crib.
I would personally wait until the child is out of the crib and into a toddler bed or regular bed before beginning potty training.
I would keep the child in diapers while in the crib because they will likely wet but if the child sleeps through the night you can work on potty training in the day and keep them in diapers at night.
Although a child may be potty trained in the daytime some children may continue wetting the bed at night and need to wear a diaper for awhile.
It's not uncommon for a child to still wear a diaper to bed until they are 8 to 13 years old.