Of course you can but there are problems you wouldn't like to run through, different platforms has diferent architectures, different memory structure, different float point, different byte length, etc. So probably your code will not work as expected os simply, output different things in each platform.
If you are working in a "high precision math" (anything that's not super mario) game you probablly will end with a messy code that doesn't work more than where it was focused to, this is why MAC and PC players can't play together, because the float point and machine arch is not the same.
You would have to sanitize your code, design your architecture, test and debug for each platform, using a middle server is a must, you can't simply connect an UNIX an a Windows machine by UDP and hope it to work, unless you want to do the middle-ware part in the client (i think it's an error).
Anyways, xBox360 development is pretty straight forward, but PS3 had a weird-as-f*** processor that did everything really hard, you would need to be an expert to know how your functions and networking will work in both, pc and there. I bet you aren't yet.
Building a game that runs in every device is not impossible tho, you can use Unity3D, UDK or other pre-build engines and just try to set up the whole thing, with documentation and try-catch you will make it work, but I wouldn't even think about building it from scratch or even release a quality product unless I had a team of developers, a good self with books about networking, archs, protocols, optimization, etc and an expert in each platform.