Here's what I've found.
Let's say I build aboveground. The tile is Outside Light. No matter what I do to it, I cannot make it Dark. However, putting a roof of any material over it will make it Inside. However, your dwarves will still not want to go there if you order them inside.
Let's say I build underground by digging out a space. It's Inside Dark. In the middle, from above, I channel out a single tile. That single tile is now Outside Light. The underground tiles around it are unaffected. If I floor over that tile from above, it becomes Inside again (though as above, Dwarves will avoid it if they can't go outside, as if it were still Outside).
Aboveground plants need light, but they can be grown Inside. So you can channel out an area aboveground, making a room below, then floor over it. The resulting underground room is Inside Light. And assuming it's sand or soil you can grow aboveground plants on it.
You can't grow underground plants on a Light tile even if it's underground.
Question: If I channel out ten Z-levels, rebuild them with floors, and muddy them, can I build farms on them? It would probably result in ten z-levels of Inside Light farm rooms. But could I even build the farms in the first place?
I know Dwarves obsessively clean muddy floors, so would they clean it up before it could be constructed?