My understanding is that they can/do on WhatsApp.
On Signal, unless there is a some bug or outright fraud, afaik they cannot - that is one of their fundamental goals, and they did a lot of work to develop communication technology that worked without revealing that metadata.
(Of course, if someone gets access to your phone, then they know who you are talking to.)