Can baseboard trim be used for window and door casing?
There's no reason it can't, and my own home is an example, having stained oak base trim around all openings as well as against the floor. I can't say I like it much, and when I update the trim I'll do away with the style, but it's not terrible. 

However, base trim is usually thinner than casing. This prevents "flush joints" from occurring where base and casing meet. In carpentry, flush joints are to be avoided because it's difficult to achieve perfect alignment in the field. By using a thicker casing, the problem is eliminated. 

Casing usually has more detail to it, making it more visually interesting. By having different styles for base and casing there's a visual separation. It may look odd to see a continuous run of trim along the wall and over a door unless an ultra-modern style is desired.

Base trim is also typically taller than casing. If the same molding is used on windows it can result in a top-heavy appearance. This is a matter of personal taste, of course.