You're able to type:
/fill x1 y1 z1 x2 y2 z2 minecraft:command_block 0 replace minecraft:stone
but when you add a datatag, it goes horribly wrong:
/fill x1 y1 z1 x2 y2 z2 minecraft:command_block 0 replace {Command:"/say hey"} minecraft:stone
though you can do this when you replace all the blocks like so:
/fill x1 y1 z1 x2 y2 z2 minecraft:command_block 0 replace {Command:"/say hey"}
or
/fill x1 y1 z1 x2 y2 z2 minecraft:command_block 0 keep {Command:"/say hey"}
but when adding a replacement block to it, will make the command incorrect due a bug in the parsing of the brackets. This is the error log of the command:
[20:57:15] Data tag parsing failed: Unbalanced curly brackets {}: Command:"/say hey"} minecraft:ston
There is no fix to this, that's why i'm doing it alternatively using the "keep" block-handling and change the air into something else, though that uses an extra commandblock
Linked issues
Comments

The problem is that this isn't a tile, this is a commandblock with a datatag, not a tile entity. Same problem occurs when trying to do this with replacing 2 blocks next to eachother to a chest with a datatag to create a double chest with items inside them.
This is a bug, because we are able to replace blocks with blocks withouth a datatag and we're able to use the default replace with a datatag, but we're not able to replace blocks with blocks with a datatag. The parsing shows some weird results in the commandblock. This claims to be a bug.

Command blocks as well as chests are block entities (former known as tile entites), see http://minecraft.gamepedia.com/Tile_entity
@unknown in MC-61864: