I mean is there anything in common between the prepositios that take the accusative, dative, or both cases?
Yes. The original meanings of the oldest prepositions in German are mostly spatial. In this case, the dative designates the location that the action/state is occurring in (e.g. Ich bin in dem Haus.), and the accusative designates the destination (e.g. Ich gehe in das Haus.) or the path (e.g. Ich gehe durch den Wald.). The non-spatial meanings are generally formed by generalisation from the spatial.
Another, newer, class of prepositions are those that take (at least in written German) the genitive (e.g. anstelle des Chefs) were historically formed from nouns, which were modified by the genitive (an der Stelle des Chefs). Because the older prepositions never take genitive, this can seem somewhat artificial, so in spoken German the dative is often used with these too.
These categories are rough and sometimes would lead you astray: e.g. nach and zu usually indicate a destination but always take dative.