I'm a Saudi national. I will ship my bike to Turkey and travel to it by air. I will have a Turkish visa of course. I will then travel on road to Bulgaria aiming to reach Romania. Do I have to apply for visa prior to reaching there or I can get it on road from both borders? I will stay travelling for a month at the most.
You will only need a Bulgarian OR Romanian visa, NOT both. Apply through the country you'll be spending the most time in.
As stated by Timatic, the database used by airlines, about Bulgaria:
Visa required, except for passengers with a C visa issued by Croatia, Cyprus, Romania or a Schengen Member State valid for the period of intended stay. They are visa exempt for a maximum stay of 90 days
And for Romania:
Visa required, except for passengers with a C visa issued by Bulgaria, Croatia or Cyprus valid for the period of intended stay. They are visa exempt for a maximum stay of 90 days.
Visas are only issued at the border if you need to enter for an important emergency (such as a funeral), didn't have the time to get a visa in advance, and can prove it.
In addition, the Bulgarian embassy requires you to be a Turkish resident. The Romanian consulate doesn't say anything on their website about this, but it may well be the same there.
As such, it is strongly recommended for you to get the visa (either Bulgarian or Romanian) before leaving Saudi
Since 1 January 2007 the Republic of Bulgaria has been applying the European Union’s Common Visa Policy, subject to the terms of the Accession Treaty. One thing that means is no distinct Transit visa (except for airport transit - Type
A). So you need a Type
C, Uniform Schengen Visa (short-term) for a short stay for the purpose of transit or a planned stay, unless exempt. I'm afraid Saudi nationals are not exempt.
Since as not a permanent resident you may have great difficulty† (in effect, the answer to your Title question is "no", not transit, not
C) in applying for a visa while in Turkey you may want to apply through VFS-Global in Saudi Arabia, where you may choose from a centre in Riyadh or Jeddah. You may lodge an application up to three months in advance of the planned time of your arrival at the Bulgarian border.
For Romania you would have completed all the hard work:
The holders of visas or residence permits issued by Bulgaria, Cyprus or Croatia.
are excused a Romanian visa.
The above assumes your time in Bulgaria and Romania will be less than 90 days - and does not consider how you might be returning from Romania.