Welcome to TONMO, the premier cephalopod interest community, and birthplace of #WorldOctopusDay and #CephalopodAwarenessDays. Founded in 2000, we are a large community of experts, hobbyists and enthusiasts, some of whom come together when we host our biennial conference. To join in on the fun, sign up. You can also become a Supporter for just $50/year to remove all ads and enjoy other perks. Follow us on Twitter for more cephy goodness.
I looked through some old posts to see what I could find; it seems there is no solid conclusion on this. Some folks have cohabited nudis with octos and have had no issue, while others have softly advised against it, given that some are poisonous -- what species are you considering? It has also been noted that nudibranches are not unlike a snail without a shell (perhaps?), and we know octos like snails. Hoping someone with experience can weigh in.
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!