Is it grammatically correct to begin a sentence with "what" if it is not a question or exclamation? For example: What a tree looks like.

"What a tree looks like." = not a sentence. It's a fragment.

You could write this, though:
What a tree looks like tells botanists what kind of tree it is.

That is not a sentence.