A website is asking me to take a picture with my id card and my id card to buy Bitcoin with it. Is it safe to do so?
Not in the US.
If you are uncomfortable sharing your id with some service, consider it also a sign that you should be wary of sharing your money with them.
ID verification is required by financial institutions that follow US-based Anti-Money Laundering / 'Know Your Client' ['AML/KYC] regulatory requirements. Many institutions outside of the US choose to follow these regulations in order to [briefly:] handle USD and interact with other US financial institutions.
Does that mean anyone asking for your ID is 'legit'? Not necessarily - After all, stealing your identity could be one more way for a scam site to profit off of you, so this doesn't necessarily prove anything. It's not even clear to me whether what you are being asked to provide is actually sufficient to meet AML requirements, so I'm not sure if it indicates anything at all. One of the dangers of such a requirement being 'required' half-heartedly is that this could be one way to attempt an air of 'legitimacy'.
Your question basically boils down to : 'is this service legitimate, or a scam?'. Unfortunately, this is going to require that you break one of the oft-touted 'benefits' of cryptocurrency: You are going to need to find a way to determine whether you can 'trust' this institution. That will require you to do your own research, in an 'industry' rife with scam fly-by-night companies. Because crypto in your own hardwallet, transacted on the blockchain may be 'trustless', but buying it requires you to have that trust in the first place.