The web service definition must know the structure of what is being returned so that it knows what fields to include in the SOAP envelope and so that the subscriber to that service knows what to expect. If you want to return one or the other you should use 2 different services or create a type that can represent both and return a collection of that, then you'd have to wrap it on the client side so that you can hide the details that don't relate to the specific use.
For example,
struct CustomerOrProduct
{
ItemType type = ItemType.Customer; // This indicates the type that the struct is currently representing
string name; // This is for products and customers
string address; // This is for customers only
}
Obviously this struct needs fleshing out with property accessors, etc. but it should give you the idea. However, I don't recommend doing it this way. Instead you should use separate services for each type you want to retrieve. After all, if you know enough to pass the needed type as a parameter, you know enough to call a different service.