Well, typeid doesn't really cast anything. It just lets you find out the type of an object.
dynamic_cast is a little bit clever, it will only let you cast from a derived class to its base class, or from a base class back to its derived class (assuming the base class object is actually of the derived class)
If you actually meant about casting like this:
MyClass a = (MyClass)SomeObject;
Then that kind of cast will pretty much allow anything.
Some handy things for you to read that google threw up:
Type casting operators in c++[
^]
Demonstrating dynamic cast[
^]