Do modern passenger aircafts like 747/787/A320/A380 have some sub-system or sensors which are plug and play that might include some kind of sensors or radars which comes as optional and can be used plug-play as and when needed as per the requirement?
It wouldn't make much sense.
By definition "plug and play" would means that the avionics automatically and silently adapts to whether whether the optional device is present or not.
This would mean that if the device is physically fitted, but not in contact with the main avionics -- say, a wire might have broken or shaken loose recently -- then the cockpit instrumentation would look exactly as if it had never been there. This is not desirable: when something the pilot thinks will be available for the flight isn't actually available you want to tell him explicitly so he can decide whether the problem needs to be planned around or reacted to.
Of course there are limits to how much the plane can itself verify that it is whole and in working order -- that's why there are preflight checklists. But to spend engineering effort specifically on allowing it to fail silently when communication with one of the sensors is lost, that would be counterproductive.
I will answer this from a US FAA regulations stand point, but you really have 2 questions here
Do modern passenger aircrafts like 747/787/A320/A380 have some sub-system
The answer to this in certain ways of looking at it is yes. Modern glass cockpit style aircraft use ARINC Data Busses to transfer the data from the sensors to the main flight computers. Depending on how you define subsystem one could argue that this data bus is in a way a sub system. I am not positive on how to actually set one up and if the devices simply plug into it and self registers or need to be manually installed and programed some how but there are sub systems on large planes that share resources.
...plug and play that might include some kind of sensors or radars which comes as optional
There are lots of requirements around aircraft instruments and the way I understand them there really is not a lot of "optional" stuff. There are with out a doubt redundant things and backup systems. With this in mind there are some systems like auto pilot that if it was not working the plane is still more than capable of flying. But as for critical flight instruments even if they are plug and play you don't really have the choice of not having them.
On a bit of a side not Aspen Avionics has recently released an all software AOA indicator that runs in their glass cockpit system. This was traditionally done with a mechanical device like this one that Garmin makes. Im not sure I would call the aspen unit plug and play as there is no physical device to plug in but it is a software plug in situation for their units and worth the mention.
Plug and play is a standard developed by IBM and Microsoft around the time windows 95 was released. The old Plug N Play standard is an attempt to make device discovery and configuration a zero touch process for end users.
The PNP standard has moved on since that time, however I could imagine some computer devices in the avionics bay utilizing USB, ISA busses to communicate and may very well comply with PnP standards of some type.
The only key component really missing is the User and the Windows operating system. So while discovery and auto-config, conflict resolution Plug N play protocols maybe present in the electronics onboard an aircraft, but likely not in support of the windows operating system.
In comparison to the PC based hardware bus systems, ARINC version 573 is the base level of functionality required from onboard data busses. Compliant equipment can communicate while allowing the FDR to capture the data.
More modern standards in the 600+ families of standards/products are designed for more modular treatment of the aviation equipment. Very similar to telecommunications rack equipment has developed since moving to digital. With modular systems based on a chassis providing comms services and power to add in cards of different capabilities and purposes. Also integrating with other separate devices that integrate via ethernet or other standard protocols to deliver the necessary services.
Telecoms and ARINC is a reasonable comparison both in form factor, technical requirements and practices. ARINC for example utilizes Harvard biphase encoding of data, pioneered in telecoms to avoid signal state corruption.
So in short, plug n play doesn't exist at least in standards on aircraft as a consumer would expect PnP to be. Device, Windows OS, hardware interface and zero touch attempt at config the device.