Themed Folder Classification
Yes you can move the output away from the code, however that's usually difficult to do with this type of procedural code. The code is extremely tightly bound, which makes separation harder than it should be!

The two function you call are fine as they are. So lets focus on those for now.

getAvailableThemes()

This function, since it's only being called once, is what I believe to be clutter. I don't see a need to separate it from the main logic. Doing so only increases the amount of times we need to look back at the code.

Also, I see no reason to cut of "Directory" in $themeDir. Spell it out for clarity.

getThemePreview()


Is the return value a "preview" or a "file"? Perhaps a better name would be getThemePreviewFile.
We can refactor the code a lot:

$preview = '../themes/'.$theme.'/preview.png';

if(!file_exists($preview)) {
    $preview = 'images/nopreview.png';
}
return $preview;    


I shortened it, and I added the extension into the literal because it doesn't look like the extension will change.


Now for the main file!

wcx_themes.php

First off, indentation should be key here. Indentation is also missing here! Readability is very important.


foreach($themeDir as $themeDir) - I don't like this at all. Collections should be pluralized.
The immediate solution to separating the HTML and the PHP that I can think of, is a templating library. Other than that, you could store the HTMl in a string, and then use sprintf or another form of replacement to build the output.