If placing foil under your pillow feels comforting and does not disturb your sleep, there is generally little reason to treat the ritual as anything more than a personal bedtime habit. Still, it should not replace proven approaches to improving sleep.
Ultimately, the interesting part may not be the aluminum foil at all. It is the quiet message behind the ritual: creating a small moment of calm can help the mind transition from the noise of the day into rest.