How to deal with start sequence in payload of communication packet?
Firstly I don't usually have an end marker.  I would normally have a payload length as part of the header.

Secondly I would usually incorporate a checksum, usually at the end of the payload (where you have the end sequence).

As for escaping characters used in the header when they appear in the payload:  Yes.  How you escape it is up to you, it's your protocol.  Options include:


Using a pre-defined "escape" character (27 is commonly used) which itself needs escaping.
Double up any reserved header characters. So say the header is 0x55 0xAA then you would transmit that in the body as 0x55 0x55 0xAA 0xAA and then recognise the double characters as a single one when decoding it.
Use different data sizes for header and payload.  If you restrict the payload to 7 bits per byte then have the header characters with the high bit set they can never appear in the body.  Makes the body bigger though.


If you're looking for a specific sequence for the header then it doesn't matter if those header characters appear individually in the body, only the entire sequence.