Yes. These two sets, and basically every other LEGO set that has been produced, are compatible with one another. The major exception to this rule is DUPLO, which is twice the size of regular LEGO system bricks. However, even DUPLO is compatible in some ways.
These two sets are both essentially just boxes with lots of bricks in them. They may include some instructions and ideas, but they are designed to allow children to build creatively. Combining pieces from both of these sets will only add to fun!