It shouldn't be a problem. Most nudibranchs have a noxious slime coating and bright colors/patterns that will discourage any predator from eating them! Octopuses are intelligent enough that they will take the hint

If you are worried about it, make sure your octo is well fed and well entertained (a bored octo tends to get into trouble).
However....nudibranchs are incredibly difficult to keep. Every species eats one specific kind of food, and will not eat anything else, eventually starving to death. For example, one kind of nudibranch only eats one very specific species of sponge. And even finding out what kind of specific food they eat can be almost impossible in and of itself as not enough research has been done. They are also incredibly sensitive to water quality. Even a small spike of nitrates will spell instant death for them. And octos eat very meaty foods which can put a lot of waste into the water. Especially in such a small tank.
I hope this helps!