All horses are genetically predisposed to prefer (train faster on) a certain surface, or sometimes both if you are lucky enough to breed a dual preference horse. However, regardless of genetic bias, you can choose which surface to train them for and they will race just fine on whichever you choose. In addition, a horse who has no genetic bias for a surface at all can still be trained to race.
A surface preference is established through certain training sessions. These are labeled in "Exercise Help" on the Exercise tab. However, if you switch surfaces for a horse, the old surface will lose familiarity the more you train the horse on the new surface.
If you have the skill that shows Morale, you can also see stars toward surface. If you do not have that skill, you can get an idea of a horse's surface preference from using the Training Advisor. Generally speaking, your 3yo+ horse (from the horse trader) should start out with at least one surface with a green star, which is going to be the one it is easier and faster to train them on. For 2 year olds, you will need to evaluate their genetics or take advantage of the training advisor.
The higher your horse's preference is for a surface, the better they will perform on it when entering races. Can you enter a horse before they are showing a green star for a surface? Absolutely. Will they be racing at their best? No - but it's still experience and can help to start building morale up sooner rather than later!