As Miriam said you can use "why" as an interjection to express surprise, approval, disapproval, consternation, etc. For example:
- Why, of course I understand.
- Why, isn't it obvious?
The dodo is surprised in this case - if I remember the story correctly - that Alice doesn't know who She (The Queen of Hearts) is. It's unbelievable that Alice wouldn't have heard of her.
I wouldn't say it's particularly commonly used these days, in everyday speech. It can sound a little bit condescending if you're not careful. It does get used though.
A word of warning: Alice in Wonderland is a great book, but Lewis Carroll's writing is deliberately bizarre at times. His aim was to play with language and laugh at how ridiculous it can be. He also liked to make up a lot of words, some of which are now common parlance (chortle), while others are not.
He liked to write gibberish and make puns out of the way language works. Enjoy the book but don't panic about how ridiculous some of it seems. It's intentional.