Synthetic dimensions in ultracold polar molecules