If physics isn't an issue, you can add arbitrarily many terms. Once the physics comes in though, you will encounter a few restrictions :
- As said by Gennaro, it is assumed that the Poincaré symmetry applies.
- Higher derivative terms (second derivatives and above) are generally bad news. They can cause vacuum instability (energies can be arbitrarily negative, making the vacuum radiate away infinitely) and, in the worst cases (such as infinitely many such terms), non-locality of the solutions. There are plenty of threads on stackexchange regarding the evils of higher derivatives, if you wish.
- Some interaction terms can also cause vacuum instability. A $\varphi^3$ interaction term also has no lowest energy.
- If any gauge symmetry is present, it will further constrain the form of the gauge field, as it will otherwise break gauge symmetry (that is part of the reason the Higgs mechanism was developed, as mass terms broke gauge symmetry for the weak field)
A domain where generic interactions are somewhat used is effective field theories. To avoid dealing with horrors like quantum chromodynamics, chiral perturbation theory writes down the most general lagrangian that obeys some approximate symmetry of the system (usually SU(2) or SU(2)xSU(2)), something of the form
$\mathcal{L}_{eff} = \sum_{(k,l)} \mathcal{L}_{(k,l)}$
With $\mathcal{L}_{(k,l)} \approx (\partial \varphi)^k \phi^l$
Usually most terms are dropped, but if you want an example of a Lagrangian in a very general form, you might want to look into it.