Tell me please the difference in meaning between the following sentenced?
I eat twice a day.
I eat twice in a day.
I am sure that in a day is a valid phrase, but I cannot figure out the difference between it and a day as in my sentences.
It is a valid phrase, but they mean different things.
"Twice a day" means every day.
"Twice in a day" would normally mean a specific day.
For example:
I once ate six times in a day.
This refers to one specific occasion on which you ate 6 times in one day. It would not make sense to say "I once ate six times a day".
For some additional information on when to use a preposition with a verb, take a look at the answer to this recent question.