Is the beam splitter transformation related to Hamiltonian? Consider a general beam splitter with input 'ports,' 1 and 2. It mathematically described by a unitary transformation $\hat{U} = exp[i\theta(\hat{a}_1^\dagger \hat{a}_2+\hat{a}_2^\dagger \hat{a}_1)]$.
Here $\hat{a}_i$ ($i=1$ or $2$) represents the annihilation operators for the electromagnetic field at the two input ports and $\theta$ is defined by writing the reflectivity $|r| = \cos\theta$ and transmissivity $|t|=\sin\theta$. This is one of the many choices of describing the beam splitter. 


*

*Is this unitary transformation same as time evolution operator for the electromagnetic field in the beam splitter? 

*If so what is the Hamiltonian? 

*Why don't we have time inside the unitary operator shown above? 

*What is the physical origin of this transformation?

 A: The operator for the beam splitter is simply a unitary transformation that gives the output of the beam splitter directly from the input. It does not incorporate any time evolution. Therefore it is not a Hamiltonian for the system. The Hamiltonian for such a linear system is trivial, because its time evolution is trivial.
A: The Hamiltonian you want is (in the interaction picture, where the $\hbar \omega_1 \hat{n}_1$ stuff is removed)  :
$$H = c ( \hat{a}^{\dagger}_1 \hat{a}_2 - \hat{a}_1 \hat{a}^\dagger_2) $$
where $c$ is some coupling strength between the modes.
The clearest way of understanding this Hamiltonian is to look at a directional coupler:

Directional couplers are beam splitters built in a more transparent way. The two waveguides are brought close, enabling a photon initially in one of the two waveguides to move into the other one. The beam splitter Hamiltonian only applies while the photons are in the beam splitter, so how long it lasts is determined by the length of the close-section. The higher the coupling strength, and the longer the waveguides are together the more likely the photon is to hop from one side to the other. (There is a length/coupling where this chance is 100%, beyond this length it can hop back and forth multiple times, resulting in effectively less than 100% crossing chance).
The splitting ratio (related to your $\theta$) is determined by the coupling constant ($c$) and the length of the beam splitter so that the overall effect of the beam splitter Hamiltonian, applied for the length of time it takes for a photon to pass through, is the unitary you wrote in the question. Mathematically
$$U = \exp\left( \frac{i}{\hbar} \int H dt  \right) $$
where the length of the time integral is the time taken for a photon to pass through the beam splitter.
(Note that for bulk optical beam splitters the "length" is not the size of the glass block, it is the length of the half-silvered mirror or whatever it is that is inside the glass block).
arXiv:quant-ph/0305007 has more details.
