No, with Dreamweaver templates, you have 2 options:
1) Use php code before the doctype on the pages created from the template
2) Control all php code before the doctype from the Template
you must choose 1 option, you cannot do both.
Using Framework builder Themes,, you can get around this limitation.