Hi - you can definitely filter on multiple portfolio and program IDs when you are building a report.
One tip though, especially if you are looking to do Matrix groupings or charts, I would put a calculated field on the Project's custom form to capture the Portfolio and Program Name. For filtering, you will still use something like Task >> Project Portfolio ID, but for the grouping you can use the Custom field and actually display the name (since the ID is the only thing on the object itself and if you switch to text mode, you can't do Matrix or Charts)
{portfolio}.{name}
{program}.{name}
Hope that makes sense for a Monday morning 😉