For example, if a particular molecule is inside a particular protein, can its absorption maxima change with respect to the isolated molecule? Also, within the same protein, can the molecule's HOMO-LUMO gap vary, depending on its location inside the protein?
The answer is a definitive affirmative yes.
You don't need to reach out for proteins, organic dyes are known to suffer from solvatochromism in function of the polarity of the solvent they are dissolved. It either may be a bathochromic shift (or, red shift) of the UV-Vis absorption recorded, or a hypsochromic shift (or blue shift). In large proteins, you equally may have variation of pockets which are more lipophilic, and other strains which are more charged/polar, too. With the right probing molecule, you may monitor these changes, too.
There are even (small molecule) organic dyes which are used as an indicator about the solvent polarity they are dissolved in:
(image credit to Wikipedia article)
e.g., of the Reichardt's dye family:
(image credit to Wikipedia article).
This not only is an issue for solutions as commonly perceived. This extends, e.g., to dyes used in organic electronics, since their mutual presence in the solid state affects light emission (both efficiency, as well as wavelength) of OLEDs, as well as light absorption and efficiency of solar cells with organic dyes.
A vaste topic ... thus only two references:
Machado V. G., and Machado C. An Easy and Versatile Experiment to Demonstrate Solvent Polarity Using Solvatochromic Dyes. J. Chem. Educ. 2001, 78, 649-651; doi 10.1021/ed078p649.
Loving, G. S.; Sainlos, M.; Imperiali, B. Monitoring protein interactions and dynamics with solvatochromic fluorophores. Trends Biotechnol. 2010, 38, 73-83; doi 10.1016/j.tibtech.2009.11.002.