On a newly installed Ubuntu system,
/opt exists but is empty. You can just run:
sudo mkdir /opt
And that will recreate it, with the correct permissions.
But if there was software installed inside when it was removed, that won't bring it back.
There probably wasn't, though. You'd likely have remembered installing it there.
/opt is not usually for programs installed automatically through Ubuntu's package manager. Instead, for the most part it's used for programs that install with their own methods, often (but not only) proprietary payware installed from CD.
If you remember how you deleted
/opt, a more specific prediction as to whether or not there was anything in it could be given. For example, if the way you remove it was to run
sudo rmdir /opt, that will only work if the directory is empty. On the other hand, if you used
rm -r, it needn't have been empty.