Can dwarfs freely walk over traps without setting them off in Dwarf Fortress?

Straight forward answer: Yes, they can walk over traps without triggering them.


More detail:

Traps that can be triggered themselves (stone-fall, weapon and cage) will not be activated by your own dwarfs, except apparently when they are unconscious (see DF Wiki).

Spike traps have to be triggered by an external mechanism anyway - pressure plate, lever, etc - and so they could be a threat to your own dwarfs, depending on how you configure them, but won't be by default (unless somehow your dwarfs drop on to them).

All other types of "trap" involve the clever deployment of various mechanism by you (to create flooding rooms, pit falls, etc) and so whether they present a danger to your dwarfs or not is entirely down to how well you design and build them.