Is PKCS#7 padding generated with a pseudo-random-number generator okay?
If the intent of the padding is to make a passive attacker learn only a range instead of the exact message length, do not use real_len + rand(max_padlen).
It is more efficient to make the length of the padded message a multiple of a given block size instead.

If your protocol has enough latitude to allow large variations of the padding length, you can use a randomized length, but watch out for replay attacks. If for a given question, the same response is always sent, the question can be sent multiple times, so that the actual response length can be eventually inferred.
In order to mitigate this, the padding length should always be the same for a given question. A simple PRF can be used to achieve this.