No, you can't directly swap a speedometer cable from a 1978 Chevy pickup to a 1979 or later model without likely encountering problems. While they might look similar, there are subtle differences in the cable ends and potentially the overall length depending on the transmission and gear ratios. The cable connector at the transmission or transfer case and the connector at the speedometer are not guaranteed to be interchangeable between those years. Attempting to force a mismatch could damage the components.
You need to find a speedometer cable specifically for the year, model, and transmission type of your 1979 or later Chevy pickup.