Aside from the need of checking the validity of the d3dtex member of the bitmap, there is nothing could go wrong, I think.
is it dangerous to declare a bitmap within a material's event function?
You are declaring a pointer to a bitmap, if you are asking about it, it is not dangerous at all. You sould not allocate static memory (malloc), create engine objects, etc. The event should stay as simple as possible.