Nucleosomes serve as general repressors by occluding target sequences for transcription factors (TFs). However, recent experiments suggested that some pioneer TFs can bind to the target sequences within nucleosomes, playing crucial roles in early stage of gene activation. Despite recent experimental results of high-resolution binding positions of pioneer TFs on nucleosomal DNA, a detailed structural and dynamic recognition mechanismis still lacking. Here we employed molecular dynamics simulations to investigate the target search of TFs on both bare and nucleosomal DNA, and spontaneous sliding dynamics of the nucleosome. We first developed a new method of modeling the sequence-specific protein-DNA interactions based on Position Weight Matrix (PWM) and PDB structure. With several applications, we illustrated the ability of our model to capture the subtlest features in protein-consensus DNA recognition. On the other side, we introduced a new model for hydrogen bonds between DNA and histone proteins and achieved a general and complete picture of spontaneous nucleosome dynamics. Finally, we combined these models together and studied the binding of pioneer TF Oct4 to a nucleosome in Lin28 gene locus. Our results confirmed the previously proposed mechanism of partial motif recognition and revealed a possible interplay between the TF binding and nucleosome dynamics.