Motorsports are not currently part of the Olympics, although there is no rule banning them. In fact, in the 1900 Olympics in Paris, automobile, motorcycle, and motorboat racing were demonstration events, and in the 1908 Games in London, there were three motorboat racing events as an official part of the games.
However, there haven't been any motorsports in the games since then. IOC president Jacques Rogge, speaking specifically about Formula One, said in 2012,
Frankly speaking, the concept we are having is the games are about the competition for the athletes not for equipment. Therefore, while having a lot of respect, they will not be included into the Olympic program. (Source)
As a result, it is not likely that we will see motorsports in the Olympics in the near future, although there are a lot of motorsports drivers and fans that would like to see these events included in the Games once again.