We consider fluctuations of the dissipated energy in nonlinear driven diffusive systems subject to bulk dissipation and boundary driving. With this aim, we extend the recently introduced macroscopic fluctuation theory to nonlinear driven dissipative media, starting from the fluctuating hydrodynamic equations describing the system mesoscopic evolution. Interestingly, the action associated with a path in mesoscopic phase space, from which large-deviation functions for macroscopic observables can be derived, has the same simple form as in nondissipative systems. This is a consequence of the quasielasticity of microscopic dynamics, required in order to have a nontrivial competition between diffusion and dissipation at the mesoscale. Euler-Lagrange equations for the optimal density and current fields that sustain an arbitrary dissipation fluctuation are also derived. A perturbative solution thereof shows that the probability distribution of small fluctuations is always Gaussian, as expected from the central limit theorem. On the other hand, strong separation from the Gaussian behavior is observed for large fluctuations, with a distribution which shows no negative branch, thus violating the Gallavotti-Cohen fluctuation theorem, as expected from the irreversibility of the dynamics. The dissipation large-deviation function exhibits simple and general scaling forms for weakly and strongly dissipative systems, with large fluctuations favored in the former case but heavily suppressed in the latter. We apply our results to a general class of diffusive lattice models for which dissipation, nonlinear diffusion, and driving are the key ingredients. The theoretical predictions are compared to extensive numerical simulations of the microscopic models, and excellent agreement is found. Interestingly, the large-deviation function is in some cases nonconvex beyond some dissipation. These results show that a suitable generalization of macroscopic fluctuation theory is capable of describing in detail the fluctuating behavior of nonlinear driven dissipative media.