Talk:IMAP folder cannot be deleted
I had a related issue to this one: I accidentally deleted a folder, which made it a subfolder of the IMAP Trash folder, but could not find a way to un-delete it. If I tried dragging it up to the parent level, I got an error message that the mailbox already existed. I was able to do the rename by drag and drop on Evolution 2.0.
Investigation with another IMAP tool showed that the folder had been renamed from "folder" to "Trash.folder". I suspect that Thunderbird has a bug and either tried a rename of "folder" to "folder" or "Trash.folder" to "Trash.folder".
Imap server support for folders that contain messages and subfolders
Some imap serveres doesnt support mail folders that contains both messages and subfolders, when you try deleting mailfolders you get the error message mentioned in the article. If you change Tools -> Account Settings -> [account name] Server Settings", "Advanced" and uncheck the option for support for folders within folders, you should be able to delete the folder.
This way you can still use trash for messages.