I wonder if heads of shrimps bought from US grocery stores are safe to eat.
If it's safe to eat the shrimp, it should be safe to eat the head. The US food authorities (FDA) have, in a way, approved of the shrimp you have bought, so it's safe to eat.
Yes , they are safe. In fact there are many people who think it's the best part of the shrimp. Although the way it's normally done is by sucking the liquid out of the head rather than eating the whole thing shell and all.
Nothing to worry about, specially if they have been frozen.
Actually, some fish stock recipes call for shrimp heads or shells.