Nuclear electron capture rate in stellar interiors and the case of 7Be