Can I opt out of the MGSV multiplayer base invasions?
No
It is not possible to use FOBs without risking invasions. Neither is it possible to not construct a FOB.2
There is no way to opt out of FOB construction as it is needed to advance the single player plot. Therefore there is no way to stop others from raiding your FOB. Being off line does not work: your FOBs can still be raided while you are offline.
It is nothing to worry about
However, just like I was, you are worrying for nothing.
I shared your exact same concerns and since FOBs are mandatory, I asked how to secure your FOB. I followed the advice given have had a FOB for several weeks now and never been invaded once. It could be a statistical blip, I might be raided as you are read this. However, my FOB is a useless piece of junk that is super defended by losers (C-rank or below) on high alert and hight technology gear.
However, even if you are raided and lose fully: It still does not matter. FOB offer you two major advantages: two more units to dispatch on missions and a huge increase in staff numbers. Those alone will offset any lose you make when being invaded.
Your FOB will be bury in a long long list of FOBs. If you invade other FOBs, then they get to know you as an enemy. Thus, they are more likely to take revenge on you1. If you do not invade them, your FOB looks like a piece of trash that will be really expensive to invade: why bother? Think of it as your FOB increasing your productivity by 100% but sometimes (very rarely) you will lose 1% of that. Net result: You have 99% increase in productivity. Still a win.
You could build a nuke. This would stop anyone without high enough heroism from invading you, turn you into Demon Snake, and turn you into a target for those with high heroism to steal your nuke to either sell it on or disarm it. I would not chose that path…
A yearly update
It has been longer than a year, since I wrote this answer, I now have two FOBs build, and have had not one invasion. However, I am raking in the benefits from being able to send two extra team of the S+ soldiers to harvest resources.
1: Almost of this was a theme of the game, or something. ☺
2: Actually, that's not true. Just do not progress past Mission 20. However, that cuts out about 30 missions and lots of side ops from the game.
These invasions aren't really bothersome.
At low levels, you aren't worth invading because you definitely don't have anything worth stealing, and the volunteers gained from invading you will also suck. Most people invade FOBs so that they can get S-rank and higher recruits, which will join them as volunteers once they invade someone with advanced-enough security. The other reason you would be invaded is that you possess a nuclear weapon, which is completely optional and doesn't even get unlocked as an option until close to the end of the game. Players will invade other players that possess nukes so that they can steal and then either sell or dismantle the nuke. Dismantling nuclear weapons gives a lot of Heroism, which is a stat that influences how many volunteers you get and how good they are.
Not that much evidence of cheating yet.
I have no experience with cheaters online, but I have seen it done in videos. Cheating is unfortunately a common problem in these Japanese-developed games with fleshed-out multiplayer features -- see Dark Souls for another case study. Japanese publishers don't ever seem to prioritize putting a stop to cheating post-release or allowing their devs to put the necessary precautions in place to prevent it. It's just an unfortunate trend that I've observed when I play any Japanese-made game's multiplayer feature. The one exception that I've witnessed is Monster Hunter, which would suffer very greatly from cheaters due to its quasi-MMO persistence and grind. Heck, there might be a lot of cheaters in MH4U -- I haven't played it at the highest tier, so I can't say for sure.
However, from my experience and discussion with others, it seems that cheating isn't a big problem in this game -- at least, not yet.
Losing an invasion isn't really something you have to worry about.
If someone infiltrates your base to its core successfully, you really don't have that much to worry about. You will lose some resources which you will have in large abundance by the end of the game and are farmed automatically in large numbers, and troops that are replaceable because they're not on your Direct Contract list. Direct Contract is a mechanic that allows you to put a limited number of staff on it so that they can't be killed or Fultoned during an infiltration. I find that the game provides ample enough Direct Contract slots so that I don't have to worry about losing the staff I actually care about.
In fact there is actually a question on this site where someone is asking how to make it easier for someone to successfully infiltrate his base, because he astutely recognized that defenders get much, much less for winning a defense than attackers get for winning an infiltration, and additionally defenders really don't lose much of value when the infiltration is successful.
From my overall view, it seems like Konami/KojiPro intended for FOBs to be a sort of "Farmville" mechanic in the game, where you can build up your bases with cool security features, up your ranking in the Virtual League, and increase your resource gain. The infiltrations seem like they were designed to be rewarding for attackers (who are just looking for extra challenging gameplay) while being minimally damaging to the defender, so they don't have to worry about being attacked. This encourages people to go out and invade FOBs frequently. The FOBs were built as a sort of additional sub-game on top of MGSV -- the features lend it towards having little impact on your actual game unless you want it to.
According to Konami - Yes.
Selecting "Online Disconnect" from the pause menu will allow you to play without being invaded by other players.
Here are the official notes:
TIPS: About Online Disconnect: If you want to play offline without worrying about coming under attack from rival players, select ONLINE DISCONNECT under the Pause Menu.
It's difficult to find validation or even much discussion about this recently introduced feature, but I have no located a single case of someone being invaded after using it.