It is important to know your guests food preferences when inviting them over. There are cultural and religious restrictions, combined with allergy and dietary food preferences ranging from vegans, diabetics to a lactose or gluten intolerant guest.
I think it is polite to ask guests, but don’t give high maintenance guests room to change your entire menu – sometimes people can get unnecessarily fussy, which is different to the above.