Dirt (or rather soil) is a common natural block most often found right under the top surface layer of many biomes as well as further down on the Fossil layer where shallow caves and tunnels often lead into.
Blocks of Dirt - like in Minecraft - will automatically turn into Grass when touching at least one block of green Grass and staying uncovered. Sunlight is not needed for this process, as the change also will happen underground, but light in general is (it can be artificial too) - in dim-lit areas the change takes a lot longer.
However, Savannah Grass, Dead Grass, Detritus or any other blocks won't have any similar effects. Also in Swamplands the change from Dirt into Grass can be exceptionally slow or come to a halt completely (perhaps because Swamplands renders Seeds, Queen Bees and Saplings fallow). Player-characters being close by will usually make Dirt change into Grass faster in return.
By throwing Corrupt Bombs at Dirt it can be turned into Corrupted Dirt. While in earlier versions it was possible to corrupt Dirt by putting Corrupted Water on or next to it and even by touching it with other corrupted blocks, this is not longer the case currently (as of R29 in February 2016).
Dirt can be tilled with Plows and can then be used for growing Crops by planting Seeds on the tilled land. If tilled land is not covered (by items or blocks) nor planted, it will turn back into Dirt in time.
Currently there are no crafting-recipes that make use of plain Dirt, so these blocks can only be placed. If enough of them are together they might make Pigsies spawn during the (ingame-)day and Night Pigsies or perhaps even Night Hoglets at night.